Created
July 25, 2016 08:11
-
-
Save robi09/0342ae1508593c16b876fcc3f06b2dfd to your computer and use it in GitHub Desktop.
Force login page WordPress
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
function redirect_login_page() { | |
$login_page = home_url('/login/'); | |
$page_viewed = basename($_SERVER['REQUEST_URI']); | |
if($page_viewed == "wp-login.php" && $_SERVER['REQUEST_METHOD'] == 'GET') { | |
wp_redirect($login_page); | |
exit; | |
} | |
} | |
add_action('init','redirect_login_page'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment