Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save verygoodplugins/75aa92920fef298644bc4e50c1f34647 to your computer and use it in GitHub Desktop.
Save verygoodplugins/75aa92920fef298644bc4e50c1f34647 to your computer and use it in GitHub Desktop.
Conditionally disable WP Fusion from syncing new contacts to your CRM based on a user_meta field value
<?php
function skip_contact_creation( $user_meta, $user_id ) {
if ( isset( $user_meta['receive_press_releases'] ) && true != $user_meta['receive_press_releases'] ) {
$user_meta = null;
}
return $user_meta;
}
add_filter( 'wpf_user_register', 'skip_contact_creation', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment