Skip to content

Instantly share code, notes, and snippets.

@hirejordansmith
Created February 2, 2017 08:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hirejordansmith/48acd541a039f885ff7b2821a4823832 to your computer and use it in GitHub Desktop.
Save hirejordansmith/48acd541a039f885ff7b2821a4823832 to your computer and use it in GitHub Desktop.
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