Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save nikitasinelnikov/c8590b873ca34f492ceac0c0be9f325e to your computer and use it in GitHub Desktop.
Save nikitasinelnikov/c8590b873ca34f492ceac0c0be9f325e to your computer and use it in GitHub Desktop.
Restrict Login Page for logged in user
add_action( 'template_redirect', 'um_restrict_login_page_logged_in' );
function um_restrict_login_page_logged_in() {
if ( um_is_core_page('login') && is_user_logged_in() ) {
wp_redirect( um_get_core_page( 'user' ) );
exit;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment