Heads up!
This article contains PHP code and is intended for developers. We offer this code as a courtesy, but don't provide support for code customizations or 3rd party development.
This article contains PHP code and is intended for developers. We offer this code as a courtesy, but don't provide support for code customizations or 3rd party development.
This hook can be used to filter a subscriber's mailchimp tags
Usage
add_filter( 'frm_mlcmp_tags', 'add_new_tag' );
Parameters
- $tags (array) An array of all tags ready to be sent to the Mailchimp API to be attached to a subscribe
- $data (array)
Examples
Add new tag
This example will add a string to attach to a subscriber as tag
add_filter( 'frm_mlcmp_tags', 'add_new_tag' );
function add_new_tag( $tags, $data ) {
if ( $data['subscriber_id'] === '123' ) {
$tags[] = array(
'name' => 'New tag',
'status' => 'active',
);
}
return $tags;
}
Replace the value (123) by the id of the subscriber to which you want to add the new tag