Skip to content
Permalink
Browse files

Accessibility: Login and Registration: Improve the invalid username a…

…nd 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@46417 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information...
afercia committed Oct 7, 2019
1 parent 2215a9b commit 5c91f0d75b10dca78f4d2b6593b67717e5e512cc
Showing with 2 additions and 8 deletions.
  1. +2 −8 src/wp-includes/user.php
@@ -149,10 +149,7 @@ function wp_authenticate_username_password( $user, $username, $password ) {
if ( ! $user ) {
return new WP_Error(
'invalid_username',
__( '<strong>ERROR</strong>: Invalid username.' ) .
' <a href="' . wp_lostpassword_url() . '">' .
__( 'Lost your password?' ) .
'</a>'
__( 'Unknown username. Check again or try your email address.' )
);
}
@@ -230,10 +227,7 @@ function wp_authenticate_email_password( $user, $email, $password ) {
if ( ! $user ) {
return new WP_Error(
'invalid_email',
__( '<strong>ERROR</strong>: Invalid email address.' ) .
' <a href="' . wp_lostpassword_url() . '">' .
__( 'Lost your password?' ) .
'</a>'
__( 'Unknown email address. Check again or try your username.' )
);
}

0 comments on commit 5c91f0d

Please sign in to comment.
You can’t perform that action at this time.