Created
May 29, 2014 20:32
-
-
Save scarstens/83afad1cce016edd63b5 to your computer and use it in GitHub Desktop.
Disable default registration page in WordPress by redirecting away. Has filter for custom redirection. Used to secure registrations that do not follow standard WordPress registration workflows.
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
add_action('init','disable_default_registration'); | |
function disable_default_registration(){ | |
global $pagenow; | |
if( 'wp-login.php' == $pagenow && $_REQUEST['action'] == 'register') { | |
$registration_redirect = apply_filters('disable_default_registration_redirect', site_url()); | |
wp_redirect($registration_redirect); | |
exit(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment