Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ******CREATE NEW MEMBER IN MY HR SUPPORT CENTER****** //
- function create_member_in_mhrsc( $user_id, $post_data ) {
- // Check if there's already a contact record
- error_log( $wp_user .' is set');
- $mhrsc_member_id = get_user_meta( $user_id, 'hrsupportcenteruid', true );
- $user_st = get_user_meta( $user_id, 'billing_state', true );
- $user_co = get_user_meta( $user_id, 'billing_company', true );
- error_log( $user_st.' is the state');
- error_log( $user_co.' is the company');
- if( ! empty( $mhrsc_member_id ) ) {
- return $mhrsc_member_id;
- error_log('Member already exists');
- } else {
- $cid = $infusionsoft_contact_id;
- $url = MYHRSC_GF_USERS_SB_URL;
- $method = "POST";
- $cid = wp_fusion()->user->get_contact_id( $user_id );
- member_data( $user_id, $cid, $url, $method, $user_st, $user_co );
- } //endelse
- } // endfunction: create_member_in_mhrsc()
- // ******CREATE NEW MEMBER IN MY HR SUPPORT CENTER****** //
- add_action( 'wpf_user_updated', 'create_member_in_mhrsc', 10, 2 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement