From bc027fb70f180c02af199809023416db0d34a188 Mon Sep 17 00:00:00 2001 From: Gary Pendergast Date: Wed, 9 Jan 2019 02:05:08 +0000 Subject: [PATCH] Login: Improve the error message when retrieving a lost password. When an invalid username or email address is entered, the form now displays a better error message. Props mrtortai, iamfriendly, TomHarrigan, afercia, pento. Fixes #31788. git-svn-id: https://develop.svn.wordpress.org/trunk@44489 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-login.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wp-login.php b/src/wp-login.php index 7cb14cb39f..41fd85c2ea 100644 --- a/src/wp-login.php +++ b/src/wp-login.php @@ -334,7 +334,7 @@ function retrieve_password() { } elseif ( strpos( $_POST['user_login'], '@' ) ) { $user_data = get_user_by( 'email', trim( wp_unslash( $_POST['user_login'] ) ) ); if ( empty( $user_data ) ) { - $errors->add( 'invalid_email', __( 'ERROR: There is no user registered with that email address.' ) ); + $errors->add( 'invalid_email', __( 'ERROR: There is no account with that username or email address.' ) ); } } else { $login = trim( $_POST['user_login'] ); @@ -357,7 +357,7 @@ function retrieve_password() { } if ( ! $user_data ) { - $errors->add( 'invalidcombo', __( 'ERROR: Invalid username or email.' ) ); + $errors->add( 'invalidcombo', __( 'ERROR: There is no account with that username or email address.' ) ); return $errors; }