• Resolved wjyeshealth

    (@wjyeshealth)


    Hi There,

    How can i configure a redirect back from the page i came from after the user has registered via WPEverest registration form ?

    Regards,
    Wen Jun.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Deepak Sharma

    (@sharmadpk03)

    Hi @wjyeshealth,

    If the page is a specific page where you want to redirect after registration then you can simply insert the URL of the page to redirect after registration in the Individual Form settings.
    You can find the Individual Form settings here: https://docs.wpeverest.com/user-registration/docs/individual-form-settings/

    Let me know if I misunderstood you.
    Regards!

    Thread Starter wjyeshealth

    (@wjyeshealth)

    Hi @sharmadpk03 ,

    Thanks and noted on the following. Also I would like to check if I am able to configure a condition , based on which sub-site my user is browsing on my multisite instance of wordpress, and to redirect them back to the respective sub-site they were browsing previously after they register on my site. As I am only configuring registration on my main site only.

    Regards,
    Wen Jun.

    Plugin Support sanjuacharya77

    (@sanjuacharya77)

    Hi @wjyeshealth,

    We are really sorry for the delayed response. Here is the code that you need to paste in your active theme’s functions.php file at the end and hope it will do a trick.

    add_action( 'user_registration_before_registration_form', 'ur_set_register_redirect_url' );
    function ur_set_register_redirect_url( $form_id ) {
    	if ( isset( $_SERVER['HTTP_REFERER'] ) ) {
    		set_transient( 'originalLoginRefererURL', $_SERVER['HTTP_REFERER'], 60 * 60 * 24 );
    	}
    }
    add_filter( 'user_registration_redirect_from_registration_page', 'ur_register_redirect_back', 10, 2 );
    function ur_register_redirect_back( $redirect, $user ) {
    	if ( true === ( $redirect_url = get_transient( 'originalLoginRefererURL' ) ) ) {
    		delete_transient( 'originalLoginRefererURL' );
    		error_log( print_r( $redirect_url, true ) );
    		return $redirect_url;
    	}
    	return $redirect_url;
    }

    Let me know whether it helps or not and I will get back to you.

    Thanks and Regards!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Redirect User to the page they came from after registration’ is closed to new replies.