Sync using user meta
-
Hi, I am using User Meta Pro (which creates custom meta data in the wp_usermeta table).
I have a custom field called “newsletter” which is just a checkbox.
I want to use the filter provided in the plugin docs to sync only those who have checked that they want to receive newsletters.
I believe the easiest way to do this is just by saying to sync where
$newsletteris not empty:add_filter( 'mailchimp_sync_should_sync_user', function( $subscribe, $user ) { // check for custom user field if( !empty( $newsletter ) ) { return true; } // do not subscribe otherwise return false; });However, this doesn’t seem to be working. In the “Status” pane in the backend I get 0/xxxx indicating to me that it does not find anyone matching those criteria.
What am I doing wrong here?
Thank you.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘Sync using user meta’ is closed to new replies.