• Hi,

    I am setting up ultimate members on a website where I created a page that logged out users are redirected to when they try to access protected content. It works fine but I would like when the user logs in with the login form that I inserted in this page they are redirected to the page whose content is protected.

    For example, this page this page automatically redirects to this one.

    But once logged in, it is impossible to return to the initial page.

    I tried with this piece of code:

    add_action( 'um_after_form', 'my_after_form', 10, 1 );
    function my_after_form( $args ) {
        echo '<input type="hidden" name="redirect_to" value="' . $_SERVER['HTTP_REFERER'] . '" >';
    }

    It works if I go through the “login” page but not in the case mentioned above.

    Do you have a solution for me ?

    Thank you

    • This topic was modified 4 years, 7 months ago by hug0g.
    • This topic was modified 4 years, 7 months ago by hug0g.
    • This topic was modified 4 years, 7 months ago by hug0g.
  • The topic ‘Restricted content redirect issue’ is closed to new replies.