• Resolved bsmolyanov

    (@bsmolyanov)


    Can the plugin redirect back to the source page after successful login, instead of showing “My Account”?

    Thank you.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Machine IT Services

    (@machineitsvcs)

    Yes, it can, but you have to make a login link or button using PHP or Javascript that references the current page.

    I recommend using PHP and setting the current page to a variable like this example:

    $redirect_page = (isset($_SERVER['HTTPS']) ? "https" : "http") . '://' . $_SERVER['HTTP_HOST'] . trim(strtok($_SERVER['REQUEST_URI'], '?')) . ($_GET ? '?' . http_build_query($_GET) : '');

    And then using the wp_login_url function for the target link:

    wp_login_url($redirect_page);

    This will also preserve any URL parameters on current page after redirect.

    Plugin Author Machine IT Services

    (@machineitsvcs)

    If you would like to take advantage of our more advanced features and support, including more in-depth implementation practices, feel free to check out our Premium version.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘After Login Redirect to Source Page/Post’ is closed to new replies.