Skip to content

Instantly share code, notes, and snippets.

@vishalbasnet23
Created March 30, 2015 07:40
Show Gist options
  • Select an option

  • Save vishalbasnet23/bf9cf7c298c0bb60d4be to your computer and use it in GitHub Desktop.

Select an option

Save vishalbasnet23/bf9cf7c298c0bb60d4be to your computer and use it in GitHub Desktop.
disable user registration from wp-login screen
<?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