Make WordPress Core


Ignore:
Timestamp:
02/01/2020 09:36:44 PM (5 years ago)
Author:
SergeyBiryukov
Message:

Accessibility: Text Changes: Use sentence case for the word Error in various error messages, instead of all caps.

Using all caps should be avoided for better readability and because screen readers may pronounce all-caps words as abbreviations.

Props afercia, ryokuhi, sabernhardt, garrett-eclipse.
See #47656, #43037, #42945.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/user.php

    r47122 r47156  
    145145    /* checking that username has been typed */
    146146    if ( $user->user_login == '' ) {
    147         $errors->add( 'user_login', __( '<strong>ERROR</strong>: Please enter a username.' ) );
     147        $errors->add( 'user_login', __( '<strong>Error</strong>: Please enter a username.' ) );
    148148    }
    149149
    150150    /* checking that nickname has been typed */
    151151    if ( $update && empty( $user->nickname ) ) {
    152         $errors->add( 'nickname', __( '<strong>ERROR</strong>: Please enter a nickname.' ) );
     152        $errors->add( 'nickname', __( '<strong>Error</strong>: Please enter a nickname.' ) );
    153153    }
    154154
     
    166166    // Check for blank password when adding a user.
    167167    if ( ! $update && empty( $pass1 ) ) {
    168         $errors->add( 'pass', __( '<strong>ERROR</strong>: Please enter a password.' ), array( 'form-field' => 'pass1' ) );
     168        $errors->add( 'pass', __( '<strong>Error</strong>: Please enter a password.' ), array( 'form-field' => 'pass1' ) );
    169169    }
    170170
    171171    // Check for "\" in password.
    172172    if ( false !== strpos( wp_unslash( $pass1 ), '\\' ) ) {
    173         $errors->add( 'pass', __( '<strong>ERROR</strong>: Passwords may not contain the character "\\".' ), array( 'form-field' => 'pass1' ) );
     173        $errors->add( 'pass', __( '<strong>Error</strong>: Passwords may not contain the character "\\".' ), array( 'form-field' => 'pass1' ) );
    174174    }
    175175
    176176    // Checking the password has been typed twice the same.
    177177    if ( ( $update || ! empty( $pass1 ) ) && $pass1 != $pass2 ) {
    178         $errors->add( 'pass', __( '<strong>ERROR</strong>: Please enter the same password in both password fields.' ), array( 'form-field' => 'pass1' ) );
     178        $errors->add( 'pass', __( '<strong>Error</strong>: Please enter the same password in both password fields.' ), array( 'form-field' => 'pass1' ) );
    179179    }
    180180
     
    184184
    185185    if ( ! $update && isset( $_POST['user_login'] ) && ! validate_username( $_POST['user_login'] ) ) {
    186         $errors->add( 'user_login', __( '<strong>ERROR</strong>: This username is invalid because it uses illegal characters. Please enter a valid username.' ) );
     186        $errors->add( 'user_login', __( '<strong>Error</strong>: This username is invalid because it uses illegal characters. Please enter a valid username.' ) );
    187187    }
    188188
    189189    if ( ! $update && username_exists( $user->user_login ) ) {
    190         $errors->add( 'user_login', __( '<strong>ERROR</strong>: This username is already registered. Please choose another one.' ) );
     190        $errors->add( 'user_login', __( '<strong>Error</strong>: This username is already registered. Please choose another one.' ) );
    191191    }
    192192
     
    195195
    196196    if ( in_array( strtolower( $user->user_login ), array_map( 'strtolower', $illegal_logins ), true ) ) {
    197         $errors->add( 'invalid_username', __( '<strong>ERROR</strong>: Sorry, that username is not allowed.' ) );
     197        $errors->add( 'invalid_username', __( '<strong>Error</strong>: Sorry, that username is not allowed.' ) );
    198198    }
    199199
    200200    /* checking email address */
    201201    if ( empty( $user->user_email ) ) {
    202         $errors->add( 'empty_email', __( '<strong>ERROR</strong>: Please enter an email address.' ), array( 'form-field' => 'email' ) );
     202        $errors->add( 'empty_email', __( '<strong>Error</strong>: Please enter an email address.' ), array( 'form-field' => 'email' ) );
    203203    } elseif ( ! is_email( $user->user_email ) ) {
    204         $errors->add( 'invalid_email', __( '<strong>ERROR</strong>: The email address isn&#8217;t correct.' ), array( 'form-field' => 'email' ) );
     204        $errors->add( 'invalid_email', __( '<strong>Error</strong>: The email address isn&#8217;t correct.' ), array( 'form-field' => 'email' ) );
    205205    } else {
    206206        $owner_id = email_exists( $user->user_email );
    207207        if ( $owner_id && ( ! $update || ( $owner_id != $user->ID ) ) ) {
    208             $errors->add( 'email_exists', __( '<strong>ERROR</strong>: This email is already registered, please choose another one.' ), array( 'form-field' => 'email' ) );
     208            $errors->add( 'email_exists', __( '<strong>Error</strong>: This email is already registered, please choose another one.' ), array( 'form-field' => 'email' ) );
    209209        }
    210210    }
Note: See TracChangeset for help on using the changeset viewer.