Accessibility: Login and Registration: Improve the invalid username and invalid email messages.

- explicitly informs users they can use their email to log in as an alternative to their username and vice-versa
- shows the `Lost your password?` link only when an wrong password has been entered
- uses a more appropriate copy by changing "invalid" to "unknown"
- removes the all caps `ERROR`

Props subrataemfluence, zalak151291, ryokuhi, SergeyBiryukov, audrasjb, joedolson, marybaum, ramiy, markjaquith, chanthaboune, afercia.
Fixes #43037.

Built from https://develop.svn.wordpress.org/trunk@46417


git-svn-id: http://core.svn.wordpress.org/trunk@46215 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrea Fercia 2019-10-07 11:54:05 +00:00
parent 0ea646a185
commit 51814d68af
2 changed files with 3 additions and 9 deletions

View File

@ -149,10 +149,7 @@ function wp_authenticate_username_password( $user, $username, $password ) {
if ( ! $user ) { if ( ! $user ) {
return new WP_Error( return new WP_Error(
'invalid_username', 'invalid_username',
__( '<strong>ERROR</strong>: Invalid username.' ) . __( 'Unknown username. Check again or try your email address.' )
' <a href="' . wp_lostpassword_url() . '">' .
__( 'Lost your password?' ) .
'</a>'
); );
} }
@ -230,10 +227,7 @@ function wp_authenticate_email_password( $user, $email, $password ) {
if ( ! $user ) { if ( ! $user ) {
return new WP_Error( return new WP_Error(
'invalid_email', 'invalid_email',
__( '<strong>ERROR</strong>: Invalid email address.' ) . __( 'Unknown email address. Check again or try your username.' )
' <a href="' . wp_lostpassword_url() . '">' .
__( 'Lost your password?' ) .
'</a>'
); );
} }

View File

@ -13,7 +13,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '5.3-beta2-46416'; $wp_version = '5.3-beta2-46417';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.