• Resolved rando390

    (@rando390)


    So, I only want people who are logged out to be able to visit the login page. I tried adjusting this with the restrict access setting but it didn’t seem to work.

    Is there another way so that if someone visits the login form page, it just redirects them to their profile or something?

Viewing 1 replies (of 1 total)
  • Thread Starter rando390

    (@rando390)

    Figured it out

    add_action( 'template_redirect', 'redirect_logged_in_users_from_login_page' );

    function redirect_logged_in_users_from_login_page() {
    if ( is_user_logged_in() && is_page( 'login' ) ) {
    wp_redirect( um_user_profile_url() );
    exit;
    }
    }

Viewing 1 replies (of 1 total)
  • The topic ‘Using restrict access ONLY to logged out users for the login form is not working’ is closed to new replies.