WordPress.org

Make WordPress Core


Ignore:
Timestamp:
06/16/2020 03:33:37 PM (18 months ago)
Author:
afercia
Message:

I18N: Remove the "Error:" prefix from error messages.

For a number of years, most of the WordPress error messages have been prefixed with "Error:". However, these messages appear in a context where it's already clear an error occurred. Whether it's an error, a warning, or any other classification, that's not so relevant for users. The content of the message is the relevant part. The "Error:" prefix doesn't add great value while it does add unnecessary complexity for the message readability.

Also, revises some of these messages to improve clarity and removes HTML from translatable strings.

Props garrett-eclipse, ramiy, SergeyBiryukov, afercia, sabernhardt, quadthemes, audrasjb.
See #47003, #43037, #42945, #15887.
Fixes #47656.

File:
1 edited

Legend:

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

    r47922 r48059  
    12401240
    12411241    if ( isset( $comment_data['comment_author'] ) && mb_strlen( $comment_data['comment_author'], '8bit' ) > $max_lengths['comment_author'] ) {
    1242         return new WP_Error( 'comment_author_column_length', __( '<strong>Error</strong>: Your name is too long.' ), 200 );
     1242        return new WP_Error( 'comment_author_column_length', __( 'Your name is too long.' ), 200 );
    12431243    }
    12441244
    12451245    if ( isset( $comment_data['comment_author_email'] ) && strlen( $comment_data['comment_author_email'] ) > $max_lengths['comment_author_email'] ) {
    1246         return new WP_Error( 'comment_author_email_column_length', __( '<strong>Error</strong>: Your email address is too long.' ), 200 );
     1246        return new WP_Error( 'comment_author_email_column_length', __( 'Your email address is too long.' ), 200 );
    12471247    }
    12481248
    12491249    if ( isset( $comment_data['comment_author_url'] ) && strlen( $comment_data['comment_author_url'] ) > $max_lengths['comment_author_url'] ) {
    1250         return new WP_Error( 'comment_author_url_column_length', __( '<strong>Error</strong>: Your URL is too long.' ), 200 );
     1250        return new WP_Error( 'comment_author_url_column_length', __( 'Your URL is too long.' ), 200 );
    12511251    }
    12521252
    12531253    if ( isset( $comment_data['comment_content'] ) && mb_strlen( $comment_data['comment_content'], '8bit' ) > $max_lengths['comment_content'] ) {
    1254         return new WP_Error( 'comment_content_column_length', __( '<strong>Error</strong>: Your comment is too long.' ), 200 );
     1254        return new WP_Error( 'comment_content_column_length', __( 'Your comment is too long.' ), 200 );
    12551255    }
    12561256
     
    33833383    if ( get_option( 'require_name_email' ) && ! $user->exists() ) {
    33843384        if ( '' == $comment_author_email || '' == $comment_author ) {
    3385             return new WP_Error( 'require_name_email', __( '<strong>Error</strong>: Please fill the required fields (name, email).' ), 200 );
     3385            return new WP_Error( 'require_name_email', __( 'Please fill the required fields (name, email).' ), 200 );
    33863386        } elseif ( ! is_email( $comment_author_email ) ) {
    3387             return new WP_Error( 'require_valid_email', __( '<strong>Error</strong>: Please enter a valid email address.' ), 200 );
     3387            return new WP_Error( 'require_valid_email', __( 'Please enter a valid email address.' ), 200 );
    33883388        }
    33893389    }
     
    34103410    $allow_empty_comment = apply_filters( 'allow_empty_comment', false, $commentdata );
    34113411    if ( '' === $comment_content && ! $allow_empty_comment ) {
    3412         return new WP_Error( 'require_valid_comment', __( '<strong>Error</strong>: Please type a comment.' ), 200 );
     3412        return new WP_Error( 'require_valid_comment', __( 'Please type your comment text.' ), 200 );
    34133413    }
    34143414
     
    34243424
    34253425    if ( ! $comment_id ) {
    3426         return new WP_Error( 'comment_save_error', __( '<strong>Error</strong>: The comment could not be saved. Please try again later.' ), 500 );
     3426        return new WP_Error( 'comment_save_error', __( 'The comment could not be saved. Please try again later.' ), 500 );
    34273427    }
    34283428
Note: See TracChangeset for help on using the changeset viewer.