WordPress.org

Make WordPress Core

Changeset 52074


Ignore:
Timestamp:
11/09/2021 03:27:58 PM (2 months ago)
Author:
hellofromTonya
Message:

Login and Registration: Improve "email already exists" registration error message.

Adds the wp_login_url() login link to the Error message to be more helpful to users when their user email already is registered.

Improves the error message to more clearly communicate next step.

Follow-up to [16009], [22124], [31963].

Props andynick, costdev, dansoschin, sabernhardt, webcommsat.
Fixes #53631.

Location:
trunk/src/wp-includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/ms-functions.php

    r51500 r52074  
    539539    // Check if the email address has been used already.
    540540    if ( email_exists( $user_email ) ) {
    541         $errors->add( 'user_email', __( 'Sorry, that email address is already used!' ) );
     541        $errors->add(
     542            'user_email',
     543            sprintf(
     544                /* translators: %s: Link to the login page. */
     545                __( '<strong>Error:</strong> This email address is already registered. <a href="%s">Log in</a> with this address or choose another one.' ),
     546                wp_login_url()
     547            )
     548        );
    542549    }
    543550
  • trunk/src/wp-includes/user.php

    r52064 r52074  
    31113111        $user_email = '';
    31123112    } elseif ( email_exists( $user_email ) ) {
    3113         $errors->add( 'email_exists', __( '<strong>Error</strong>: This email is already registered. Please choose another one.' ) );
     3113        $errors->add(
     3114            'email_exists',
     3115            sprintf(
     3116                /* translators: %s: Link to the login page. */
     3117                __( '<strong>Error:</strong> This email address is already registered. <a href="%s">Log in</a> with this address or choose another one.' ),
     3118                wp_login_url()
     3119            )
     3120        );
    31143121    }
    31153122
Note: See TracChangeset for help on using the changeset viewer.