Created
April 12, 2012 07:28
-
-
Save glueckpress/2365436 to your computer and use it in GitHub Desktop.
Block ANY access to wp-login.php and redirect to a given URL (here: home_url() ).
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
<?php | |
add_action( 'init', 'custom_init_function' ); | |
function custom_init_function() { | |
global $pagenow; | |
if( ! is_user_logged_in() && 'wp-login.php' == $pagenow ) { | |
wp_redirect( home_url() ); // redirect URL | |
exit(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment