I would like to able to redirect to get_bloginfo('url');
after reseting password.
But I cannot for life of me find any simple answer or function to do this.
Does anyone know if this is possible?
Thank
Josh
Here is a simple solution. Im hooking into login_headerurl
. Maybe there is a better hook for this but it works, Put this in your functions.php:
function wpse_lost_password_redirect() {
// Check if have submitted
$confirm = ( isset($_GET['checkemail'] ) ? $_GET['checkemail'] : '' );
if( $confirm ) {
wp_redirect( home_url() );
exit;
}
}
add_action('login_headerurl', 'wpse_lost_password_redirect');
What it does, it runs on login_headerurl
and checks for the GET parameter “checkedmail” which you get after you submitted a valid username or email. Then i redirect by using the awsome function wp_redirect to the home_url.
UPDATE after comment
If you want to redirect the user after submitted a new password you only need to use the hook password_reset here is an example:
function wpse_lost_password_redirect() {
wp_redirect( home_url() );
exit;
}
add_action('after_password_reset', 'wpse_lost_password_redirect');