Make WordPress Core


Ignore:
Timestamp:
06/21/2020 01:58:46 PM (5 years ago)
Author:
afercia
Message:

I18N: Restore the "Error:" prefix for error messages.

Partially reverts [48059] as there's no full consensus on the removal of the text prefix. Further actions should be taken to improve consistency and accessibility of the admin notices. Keeps some improvements to the translatable strings from [48059].

Fixes #47656.

File:
1 edited

Legend:

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

    r48110 r48115  
    12441244
    12451245    if ( isset( $comment_data['comment_author'] ) && mb_strlen( $comment_data['comment_author'], '8bit' ) > $max_lengths['comment_author'] ) {
    1246         return new WP_Error( 'comment_author_column_length', __( 'Your name is too long.' ), 200 );
     1246        return new WP_Error( 'comment_author_column_length', __( '<strong>Error</strong>: Your name is too long.' ), 200 );
    12471247    }
    12481248
    12491249    if ( isset( $comment_data['comment_author_email'] ) && strlen( $comment_data['comment_author_email'] ) > $max_lengths['comment_author_email'] ) {
    1250         return new WP_Error( 'comment_author_email_column_length', __( 'Your email address is too long.' ), 200 );
     1250        return new WP_Error( 'comment_author_email_column_length', __( '<strong>Error</strong>: Your email address is too long.' ), 200 );
    12511251    }
    12521252
    12531253    if ( isset( $comment_data['comment_author_url'] ) && strlen( $comment_data['comment_author_url'] ) > $max_lengths['comment_author_url'] ) {
    1254         return new WP_Error( 'comment_author_url_column_length', __( 'Your URL is too long.' ), 200 );
     1254        return new WP_Error( 'comment_author_url_column_length', __( '<strong>Error</strong>: Your URL is too long.' ), 200 );
    12551255    }
    12561256
    12571257    if ( isset( $comment_data['comment_content'] ) && mb_strlen( $comment_data['comment_content'], '8bit' ) > $max_lengths['comment_content'] ) {
    1258         return new WP_Error( 'comment_content_column_length', __( 'Your comment is too long.' ), 200 );
     1258        return new WP_Error( 'comment_content_column_length', __( '<strong>Error</strong>: Your comment is too long.' ), 200 );
    12591259    }
    12601260
     
    33993399    if ( get_option( 'require_name_email' ) && ! $user->exists() ) {
    34003400        if ( '' == $comment_author_email || '' == $comment_author ) {
    3401             return new WP_Error( 'require_name_email', __( 'Please fill the required fields (name, email).' ), 200 );
     3401            return new WP_Error( 'require_name_email', __( '<strong>Error</strong>: Please fill the required fields (name, email).' ), 200 );
    34023402        } elseif ( ! is_email( $comment_author_email ) ) {
    3403             return new WP_Error( 'require_valid_email', __( 'Please enter a valid email address.' ), 200 );
     3403            return new WP_Error( 'require_valid_email', __( '<strong>Error</strong>: Please enter a valid email address.' ), 200 );
    34043404        }
    34053405    }
     
    34263426    $allow_empty_comment = apply_filters( 'allow_empty_comment', false, $commentdata );
    34273427    if ( '' === $comment_content && ! $allow_empty_comment ) {
    3428         return new WP_Error( 'require_valid_comment', __( 'Please type your comment text.' ), 200 );
     3428        return new WP_Error( 'require_valid_comment', __( '<strong>Error</strong>: Please type your comment text.' ), 200 );
    34293429    }
    34303430
     
    34403440
    34413441    if ( ! $comment_id ) {
    3442         return new WP_Error( 'comment_save_error', __( 'The comment could not be saved. Please try again later.' ), 500 );
     3442        return new WP_Error( 'comment_save_error', __( '<strong>Error</strong>: The comment could not be saved. Please try again later.' ), 500 );
    34433443    }
    34443444
Note: See TracChangeset for help on using the changeset viewer.