• Resolved hastibe

    (@hastibe)


    Using the “Ultimate Member: Content Restriction” panel at the bottom of the page editor, I noticed that restricting the Login page to redirect logged-in users doesn’t work.

    In trying to figure out why, I noticed on this Ultimate Member documentation page on how to restrict content that it notes “Exception:?Login, Registration, Password Reset have?special restriction logic and can not be restricted in this way.

    I know there are cases where site owners wouldn’t want to redirect logged-in users away from these pages, but, for those who do, is there any way to automatically redirect logged-in users who navigate to the login page, registration page, or password reset page?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support andrewshu

    (@andrewshu)

    Hello @hastibe

    You could use this hook (ID – id of the login page, URL – redirect page):

    add_action( 'template_redirect', 'redirect_to_specific_page' );
    function redirect_to_specific_page() {
        if ( is_page( ID ) && is_user_logged_in() ) {
            wp_redirect( URL );
            exit();
        }
    }

    Regards.

    Plugin Support andrewshu

    (@andrewshu)

    Hi @hastibe

    This thread has been inactive for a while so we’re going to go ahead and mark it Resolved.

    Please feel free to re-open this thread if any other questions come up and we’d be happy to help. ??

    Regards

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Way to redirect already logged-in users from the Login and Registration pages?’ is closed to new replies.