Advertisement
verygoodplugins

Untitled

Oct 30th, 2019
240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ******CREATE NEW MEMBER IN MY HR SUPPORT CENTER****** //
  2.   function create_member_in_mhrsc( $user_id, $post_data ) {  
  3.  
  4.       // Check if there's already a contact record
  5.  
  6.       error_log( $wp_user .' is set');
  7.  
  8.       $mhrsc_member_id  =   get_user_meta( $user_id, 'hrsupportcenteruid', true );
  9.       $user_st          =   get_user_meta( $user_id, 'billing_state', true );
  10.       $user_co          =   get_user_meta( $user_id, 'billing_company', true  );
  11.  
  12.       error_log( $user_st.' is the state');
  13.       error_log( $user_co.' is the company');
  14.  
  15.  
  16.       if( ! empty( $mhrsc_member_id ) ) {
  17.      
  18.         return $mhrsc_member_id;
  19.  
  20.         error_log('Member already exists');
  21.  
  22.       } else {
  23.        
  24.         $cid    =   $infusionsoft_contact_id;
  25.  
  26.         $url = MYHRSC_GF_USERS_SB_URL;
  27.         $method = "POST";
  28.  
  29.         $cid = wp_fusion()->user->get_contact_id( $user_id );
  30.  
  31.         member_data( $user_id, $cid, $url, $method, $user_st, $user_co );
  32.  
  33.       } //endelse  
  34.    
  35.   }  // endfunction: create_member_in_mhrsc()
  36.  
  37. // ******CREATE NEW MEMBER IN MY HR SUPPORT CENTER****** //
  38. add_action( 'wpf_user_updated', 'create_member_in_mhrsc', 10, 2 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement