Make WordPress Core


Ignore:
Timestamp:
06/02/2022 03:03:39 PM (2 years ago)
Author:
audrasjb
Message:

Text Changes: Improve consistency of admin error notices.

This changeset replaces <strong>Error</strong>: with <strong>Error:</strong>, for better consistency.

Props transl8or, mihaidumitrascu, audrasjb.
Fixes #50785.

File:
1 edited

Legend:

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

    r53455 r53458  
    144144    /* checking that username has been typed */
    145145    if ( '' === $user->user_login ) {
    146         $errors->add( 'user_login', __( '<strong>Error</strong>: Please enter a username.' ) );
     146        $errors->add( 'user_login', __( '<strong>Error:</strong> Please enter a username.' ) );
    147147    }
    148148
    149149    /* checking that nickname has been typed */
    150150    if ( $update && empty( $user->nickname ) ) {
    151         $errors->add( 'nickname', __( '<strong>Error</strong>: Please enter a nickname.' ) );
     151        $errors->add( 'nickname', __( '<strong>Error:</strong> Please enter a nickname.' ) );
    152152    }
    153153
     
    165165    // Check for blank password when adding a user.
    166166    if ( ! $update && empty( $pass1 ) ) {
    167         $errors->add( 'pass', __( '<strong>Error</strong>: Please enter a password.' ), array( 'form-field' => 'pass1' ) );
     167        $errors->add( 'pass', __( '<strong>Error:</strong> Please enter a password.' ), array( 'form-field' => 'pass1' ) );
    168168    }
    169169
    170170    // Check for "\" in password.
    171171    if ( false !== strpos( wp_unslash( $pass1 ), '\\' ) ) {
    172         $errors->add( 'pass', __( '<strong>Error</strong>: Passwords may not contain the character "\\".' ), array( 'form-field' => 'pass1' ) );
     172        $errors->add( 'pass', __( '<strong>Error:</strong> Passwords may not contain the character "\\".' ), array( 'form-field' => 'pass1' ) );
    173173    }
    174174
    175175    // Checking the password has been typed twice the same.
    176176    if ( ( $update || ! empty( $pass1 ) ) && $pass1 != $pass2 ) {
    177         $errors->add( 'pass', __( '<strong>Error</strong>: Passwords do not match. Please enter the same password in both password fields.' ), array( 'form-field' => 'pass1' ) );
     177        $errors->add( 'pass', __( '<strong>Error:</strong> Passwords do not match. Please enter the same password in both password fields.' ), array( 'form-field' => 'pass1' ) );
    178178    }
    179179
     
    183183
    184184    if ( ! $update && isset( $_POST['user_login'] ) && ! validate_username( $_POST['user_login'] ) ) {
    185         $errors->add( 'user_login', __( '<strong>Error</strong>: This username is invalid because it uses illegal characters. Please enter a valid username.' ) );
     185        $errors->add( 'user_login', __( '<strong>Error:</strong> This username is invalid because it uses illegal characters. Please enter a valid username.' ) );
    186186    }
    187187
    188188    if ( ! $update && username_exists( $user->user_login ) ) {
    189         $errors->add( 'user_login', __( '<strong>Error</strong>: This username is already registered. Please choose another one.' ) );
     189        $errors->add( 'user_login', __( '<strong>Error:</strong> This username is already registered. Please choose another one.' ) );
    190190    }
    191191
     
    194194
    195195    if ( in_array( strtolower( $user->user_login ), array_map( 'strtolower', $illegal_logins ), true ) ) {
    196         $errors->add( 'invalid_username', __( '<strong>Error</strong>: Sorry, that username is not allowed.' ) );
     196        $errors->add( 'invalid_username', __( '<strong>Error:</strong> Sorry, that username is not allowed.' ) );
    197197    }
    198198
    199199    /* checking email address */
    200200    if ( empty( $user->user_email ) ) {
    201         $errors->add( 'empty_email', __( '<strong>Error</strong>: Please enter an email address.' ), array( 'form-field' => 'email' ) );
     201        $errors->add( 'empty_email', __( '<strong>Error:</strong> Please enter an email address.' ), array( 'form-field' => 'email' ) );
    202202    } elseif ( ! is_email( $user->user_email ) ) {
    203         $errors->add( 'invalid_email', __( '<strong>Error</strong>: The email address is not correct.' ), array( 'form-field' => 'email' ) );
     203        $errors->add( 'invalid_email', __( '<strong>Error:</strong> The email address is not correct.' ), array( 'form-field' => 'email' ) );
    204204    } else {
    205205        $owner_id = email_exists( $user->user_email );
    206206        if ( $owner_id && ( ! $update || ( $owner_id != $user->ID ) ) ) {
    207             $errors->add( 'email_exists', __( '<strong>Error</strong>: This email is already registered. Please choose another one.' ), array( 'form-field' => 'email' ) );
     207            $errors->add( 'email_exists', __( '<strong>Error:</strong> This email is already registered. Please choose another one.' ), array( 'form-field' => 'email' ) );
    208208        }
    209209    }
Note: See TracChangeset for help on using the changeset viewer.