Created
July 24, 2017 14:29
-
-
Save mennwebs/3990546ddf0ee5210dfa480009fafd8d to your computer and use it in GitHub Desktop.
WordPress - Redirect Login to /account/ page
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function seed_login_redirect(){ | |
global $pagenow; | |
if('wp-login.php' == $pagenow) { | |
if(isset($_POST['wp-submit']) || // in case of LOGIN | |
(isset($_GET['action']) && $_GET['action']=='logout') || // in case of LOGOUT | |
(isset($_GET['checkemail']) && $_GET['checkemail']=='confirm') || // in case of LOST PASSWORD | |
(isset($_GET['checkemail']) && $_GET['checkemail']=='registered')) return; // in case of REGISTER | |
else wp_redirect(home_url('/account/')); // or wp_redirect(home_url('/login')); | |
exit(); | |
} | |
} | |
add_action('init','seed_login_redirect'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Credit: https://wordpress.org/support/topic/how-to-change-the-login-link-for-comments/#post-9224784