Custom Registration page – prevent redirect to wp-login.php?action=register

I already have a custom login from built with the following code:

add_action('login_redirect', 'jwh_redirect_login', 10, 3);
function jwh_redirect_login($redirect_to, $url, $user) {

$url = current(explode('?', $url));

if($user->errors['empty_password']){
    wp_redirect( $url . '?jwh_error=nopass');
}
else if($user->errors['empty_username']){
    wp_redirect( $url . '?jwh_error=nouser');
}
else if($user->errors['incorrect_password']){
    wp_redirect( $url . '?jwh_error=invalidpass');
}
else if($user->errors['invalid_username']){
    wp_redirect( $url . '?jwh_error=invaliduser');
}
else if(!empty($user->data)){
    wp_redirect( $url);
}
else{
    wp_redirect($url . '?jwh_error="nothing');
}

exit;
}

Works great. User stays in place no matter the error or successful login. Now for the registration part. Problem there is if there is a registration error of any kind, the use is redirected to Is there a similiar hook I can use to site-url/wp-login.php?action=register

Read More

Is there a hook similar to login_redirect but for registration?

Related posts