• Resolved graphiclux

    (@graphiclux)


    We will be sending out email marketing emails that will contain direct URL’s to products. We want it so if the user is not logged in and does not have an account that when they click on the direct link it will take them to a login/register page. Right now we have this in place but it just redirects the user to the default redirect page (setting, which is the HP right now). Once the user logs in from here or registers, it just keeps them on that default page. We would want this to redirect back to the original link they intended to see. Any chance of that?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor genetech

    (@genetech)

    Hi,

    You can use the filter ‘login_redirect’ to handle the after login redirect page request.
    Copy the code below and paste it into your current theme’s functions.php file.

    add_filter('login_redirect', 'my_login_redirect', 10, 3);
    function my_login_redirect($redirect_to,  $requested_redirect_to, $user) {
        $redirect_to = $_SERVER['HTTP_REFERER'];
        return $redirect_to;
    }

    Let us know if you need further assistance.

    Thank you

    Plugin Contributor genetech

    (@genetech)

    Hi,

    We haven’t heard back from you in a while, so we are going to mark this as resolved. Feel free to start a new thread if you have any further questions!

    Thank you

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Redirect after Logging in to the original URL’ is closed to new replies.