Created
April 23, 2018 11:32
-
-
Save nikitasinelnikov/c8590b873ca34f492ceac0c0be9f325e to your computer and use it in GitHub Desktop.
Restrict Login Page for logged in user
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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