0

add_action( 'gform_user_registered', 'practice_gf_registration_autologin',  10, 4 );
function practice_gf_registration_autologin( $user_id, $user_config, $entry, $password ) {
    $user = get_userdata( $user_id );
    $user_login = $user->user_login;
    $user_password = $password;
    if($entry['form_id']==4){
        $user_p_id = "user_".$user_id; // user ID = 2
        update_field( 'profile_type', 'provider-booking', $user_p_id );
    }
//for auto login
    wp_signon( array(
        'user_login' => $user_login,
        'user_password' =>  $user_password,
        'remember' => false
     ) );
}

Jagdish Sarma Asked question August 11, 2021
Add a Comment