Advertisement
justrjlewis

create_user function

Oct 30th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.15 KB | None | 0 0
  1. // ******CREATE NEW MEMBER IN MY HR SUPPORT CENTER****** //
  2.   function create_member_in_mhrsc( $user_id, $infusionsoft_contact_id, $post_data ) {  
  3.  
  4.       // Check if there's already a contact record
  5.  
  6.       $wp_user  =   $user_id;
  7.  
  8.       error_log( $wp_user .' is set');
  9.  
  10.       $mhrsc_member_id  =   get_user_meta( $wp_user, 'hrsupportcenteruid', true );
  11.       $user_st          =   get_user_meta( '192', 'billing_state', true );
  12.       $user_co          =   get_user_meta( $wp_user, 'billing_company', true  );
  13.  
  14.       error_log( $user_st.' is the state');
  15.       error_log( $user_co.' is the company');
  16.  
  17.  
  18.       if( ! empty( $mhrsc_member_id ) ) {
  19.      
  20.         return $mhrsc_member_id;
  21.  
  22.         error_log('Member already exists');
  23.  
  24.       } else {
  25.        
  26.         $cid    =   $infusionsoft_contact_id;
  27.  
  28.         $url = MYHRSC_GF_USERS_SB_URL;
  29.         $method = "POST";
  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_created', 'create_member_in_mhrsc', 10, 3 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement