diff --git a/includes/class-wc-form-handler.php b/includes/class-wc-form-handler.php index 03ac778121a..657f86feb12 100644 --- a/includes/class-wc-form-handler.php +++ b/includes/class-wc-form-handler.php @@ -826,9 +826,7 @@ class WC_Form_Handler { do_action( 'woocommerce_customer_reset_password', $user ); - wc_add_notice( __( 'Your password has been reset.', 'woocommerce' ) . ' ' . __( 'Log in', 'woocommerce' ) . '' ); - - wp_redirect( remove_query_arg( array( 'key', 'login' ) ) ); + wp_redirect( add_query_arg( 'reset', 'true', remove_query_arg( array( 'key', 'login' ) ) ) ); exit; } } diff --git a/includes/shortcodes/class-wc-shortcode-my-account.php b/includes/shortcodes/class-wc-shortcode-my-account.php index 6d764007f5c..ae15c18cde1 100644 --- a/includes/shortcodes/class-wc-shortcode-my-account.php +++ b/includes/shortcodes/class-wc-shortcode-my-account.php @@ -183,7 +183,7 @@ class WC_Shortcode_My_Account { $args = array( 'form' => 'lost_password' ); // process reset key / login from email confirmation link - if( isset( $_GET['key'] ) && isset( $_GET['login'] ) ) { + if ( isset( $_GET['key'] ) && isset( $_GET['login'] ) ) { $user = self::check_password_reset_key( $_GET['key'], $_GET['login'] ); @@ -193,6 +193,8 @@ class WC_Shortcode_My_Account { $args['key'] = esc_attr( $_GET['key'] ); $args['login'] = esc_attr( $_GET['login'] ); } + } elseif ( isset( $_GET['reset'] ) ) { + wc_add_notice( __( 'Your password has been reset.', 'woocommerce' ) . ' ' . __( 'Log in', 'woocommerce' ) . '' ); } wc_get_template( 'myaccount/form-lost-password.php', $args );