Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 1 replies (of 1 total)

  • maustingraphics82
    Participant

    @maustingraphics82

    I think the issue is within this part of the code but posted everything in the message above.

    // Create a new user
    		$new_user_id = wp_insert_user( $userdata );
    
    		// GFCommon::log_debug( __METHOD__ . '(): form => ' . print_r( $birthdate, true ) );
    
    		if ( ! is_wp_error( $new_user_id ) ) {
    			groups_join_group( $group_id, $new_user_id );
    
    			// Make the user displayed as a staff on a clubhouse page
    			if ( $role === 'staff' ) {
    				$group_ids =  groups_get_user_groups( $new_user_id );
    				$group = groups_get_group( array( 'group_id' => $group_ids['groups'][0]) );
    				$group_id = $group->id;
    				groups_promote_member( $new_user_id, $group_id, 'admin' );
    			} else {
    				groups_demote_member( $new_user_id, $group_id );
    			}
    
    			if ( ! empty( $notification ) ) {
    				tml_send_new_user_notifications( $new_user_id, 'both' );
    			}
    
    			if ( ! empty( $birthdate ) ) {
    				$date = DateTime::createFromFormat('Y-m-d', $birthdate);
    				$date = $date->format('Ymd');
    
    				update_field('user_birthdate', $date, 'user_' . $new_user_id);
    			}
    		}
Viewing 1 replies (of 1 total)
Skip to toolbar