Hook into login_form_register
and throw people to your registration page with wp_redirect
.
<?php
add_action( 'login_form_register', 'wpse45134_catch_register' );
/**
* Redirects visitors to `wp-login.php?action=register` to
* `site.com/register`
*/
function wpse45134_catch_register()
{
wp_redirect( home_url( '/register' ) );
exit(); // always call `exit()` after `wp_redirect`
}
You can also hide the “register” link on that page by hijacking the user_can_register
option on the login page. Hook into login_form_lostpassword
and login_form_retrievepassword
, from there add a filter to pre_option_users_can_register
.
<?php
add_action( 'login_form_lostpassword', 'wpse45134_filter_option' );
add_action( 'login_form_retrievepassword', 'wpse45134_filter_option' );
/**
* Simple wrapper around a call to add_filter to make sure we only
* filter an option on the login page.
*/
function wpse45134_filter_option()
{
// use __return_zero because pre_option_{$opt} checks
// against `false`
add_filter( 'pre_option_users_can_register', '__return_zero' );
}
As a plugin.