Created
March 30, 2015 07:40
-
-
Save vishalbasnet23/bf9cf7c298c0bb60d4be to your computer and use it in GitHub Desktop.
disable user registration from wp-login screen
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
| <?php | |
| add_action( 'login_head', 'hide_login_nav' ); | |
| function hide_login_nav() | |
| { | |
| ?><style>#backtoblog{display:none}</style><?php | |
| } | |
| /** | |
| * remove the register link from the wp-login.php script | |
| */ | |
| add_filter('option_users_can_register', function($value) { | |
| $script = basename(parse_url($_SERVER['SCRIPT_NAME'], PHP_URL_PATH)); | |
| if ($script == 'wp-login.php') { | |
| $value = false; | |
| } | |
| return $value; | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment