Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Redirect WordPress Registration page to a Custom Registration Page
<?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
You can’t perform that action at this time.