Created
February 2, 2017 08:44
-
-
Save hirejordansmith/48acd541a039f885ff7b2821a4823832 to your computer and use it in GitHub Desktop.
Redirect WordPress Registration page to a Custom Registration Page
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_filter('register','hjs_register_url'); | |
function hjs_register_url($link){ | |
/* Change wp registration url */ | |
return str_replace(site_url('wp-login.php?action=register', 'login'),site_url('register', 'login'),$link); | |
} | |
add_filter('site_url', 'hjs_fix_register_urls', 10, 3); | |
function hjs_fix_register_urls($url, $path, $orig_scheme){ | |
/* | |
Site URL hack to overwrite register url | |
http://en.bainternet.info/2012/wordpress-easy-login-url-with-no-htaccess | |
*/ | |
if ($orig_scheme !== 'login') | |
return $url; | |
if ($path == 'wp-login.php?action=register') | |
return site_url('register', 'login'); | |
return $url; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment