Created
September 20, 2016 17:04
-
-
Save cjwd-snippets/4cda826d2177d7caccfb84497ef269d6 to your computer and use it in GitHub Desktop.
Redirects wp-login.php to custom login page
This file contains hidden or 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('init', 'studious_redirect_to_custom_login'); | |
| function studious_redirect_to_custom_login() { | |
| $login_page = home_url('/login/'); | |
| $page = basename($_SERVER['REQUEST_URI']); | |
| if( $page == "wp-login.php" && $_SERVER['REQUEST_METHOD'] == 'GET') { | |
| wp_redirect($login_page); | |
| exit; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment