Advertisement
verygoodplugins

Untitled

Dec 13th, 2017
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.55 KB | None | 0 0
  1. // This function makes WP Fusion work with the mess that is the "signupforms" plugin. Do not remove.
  2.  
  3. function wpf_add_signupforms_users() {
  4.  
  5.     $args = array(
  6.         'fields'     => 'ID',
  7.         'meta_query' => array(
  8.             array(
  9.                 'key'     => wp_fusion()->crm->slug . '_contact_id',
  10.                 'compare' => 'NOT EXISTS'
  11.             )
  12.         )
  13.     );
  14.  
  15.     $users = get_users( $args );
  16.  
  17.     if( !empty( $users ) ) {
  18.  
  19.         foreach( $users as $user_id ) {
  20.             wp_fusion()->user->user_register( $user_id, null, true );
  21.         }
  22.  
  23.     }
  24.  
  25.  
  26. }
  27.  
  28. add_action( 'init', 'wpf_add_signupforms_users' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement