I created some custom login/registration template pages and now I want that every request to wp-login.php to be redirected to a custom url. Now I have something like this:
add_action('init','possibly_redirect');
function possibly_redirect(){
global $pagenow;
if( '/wp-login.php' == $pagenow ) {
wp_redirect('/login');
exit();
}
}
but it doesn't work properly because when I click a logout link (in a meta widget) it will redirect me to the /login link and not doing logout. Do you have other method to do this in a safe or a better way ? Thank you.
if ( isset( $_GET['action'] ) && $_GET['action'] == 'logout' ) return;
for example.