• Resolved gabrielsfreela

    (@gabrielsfreela)


    Hello, I would like to redirect a user type to another page after the first login.

    This user is only approved by email, and I need to redirect him after he’s approved.

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Support Sandip Pokhrel

    (@sandippokharel)

    Hi @gabrielsfreela

    Thanks for writing in,

    For redirecting to specific page after the email confirmation link has been clicked, please add the following codes to the functions.php of your theme file.

    
    add_action( 'user_registration_check_token_complete', 'ur_auto_login_email_verification', 10, 2 );
    function ur_auto_login_email_verification( $user_id, $user_reg_successful ) {
    	if( true === $user_reg_successful ) {
    		wp_set_auth_cookie( $user_id );
    	    $form_id_array = get_user_meta( $user_id, 'ur_form_id' );
    	    $form_id       = 0;
           $url = '';
    	    if ( isset( $form_id_array[0] ) ) {
    		    $form_id = $form_id_array[0];
    	    }
           if ( '432' === $form_id ) {
    		   $url = "https://userregistration.dev/member/";
    	    } else if ( '432' === $form_id ) {
    		   $url = "https://userregistration.dev/partner/";
    	    }
    		wp_safe_redirect( $url );
    		die();
    	}
    }
    

    Please note: ‘432’ is the form id and you will have to add the form id of the specific form with Email Confirmation login option.

    Regards!
    WPEverest Support Team.

Viewing 1 replies (of 1 total)
  • The topic ‘Redirect after login’ is closed to new replies.