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. Built from https://develop.svn.wordpress.org/trunk@47156 git-svn-id: http://core.svn.wordpress.org/trunk@46956 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -1224,19 +1224,19 @@ function wp_check_comment_data_max_lengths( $comment_data ) {
|
||||
$max_lengths = wp_get_comment_fields_max_lengths();
|
||||
|
||||
if ( isset( $comment_data['comment_author'] ) && mb_strlen( $comment_data['comment_author'], '8bit' ) > $max_lengths['comment_author'] ) {
|
||||
return new WP_Error( 'comment_author_column_length', __( '<strong>ERROR</strong>: Your name is too long.' ), 200 );
|
||||
return new WP_Error( 'comment_author_column_length', __( '<strong>Error</strong>: Your name is too long.' ), 200 );
|
||||
}
|
||||
|
||||
if ( isset( $comment_data['comment_author_email'] ) && strlen( $comment_data['comment_author_email'] ) > $max_lengths['comment_author_email'] ) {
|
||||
return new WP_Error( 'comment_author_email_column_length', __( '<strong>ERROR</strong>: Your email address is too long.' ), 200 );
|
||||
return new WP_Error( 'comment_author_email_column_length', __( '<strong>Error</strong>: Your email address is too long.' ), 200 );
|
||||
}
|
||||
|
||||
if ( isset( $comment_data['comment_author_url'] ) && strlen( $comment_data['comment_author_url'] ) > $max_lengths['comment_author_url'] ) {
|
||||
return new WP_Error( 'comment_author_url_column_length', __( '<strong>ERROR</strong>: Your url is too long.' ), 200 );
|
||||
return new WP_Error( 'comment_author_url_column_length', __( '<strong>Error</strong>: Your URL is too long.' ), 200 );
|
||||
}
|
||||
|
||||
if ( isset( $comment_data['comment_content'] ) && mb_strlen( $comment_data['comment_content'], '8bit' ) > $max_lengths['comment_content'] ) {
|
||||
return new WP_Error( 'comment_content_column_length', __( '<strong>ERROR</strong>: Your comment is too long.' ), 200 );
|
||||
return new WP_Error( 'comment_content_column_length', __( '<strong>Error</strong>: Your comment is too long.' ), 200 );
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -3352,9 +3352,9 @@ function wp_handle_comment_submission( $comment_data ) {
|
||||
|
||||
if ( get_option( 'require_name_email' ) && ! $user->exists() ) {
|
||||
if ( '' == $comment_author_email || '' == $comment_author ) {
|
||||
return new WP_Error( 'require_name_email', __( '<strong>ERROR</strong>: Please fill the required fields (name, email).' ), 200 );
|
||||
return new WP_Error( 'require_name_email', __( '<strong>Error</strong>: Please fill the required fields (name, email).' ), 200 );
|
||||
} elseif ( ! is_email( $comment_author_email ) ) {
|
||||
return new WP_Error( 'require_valid_email', __( '<strong>ERROR</strong>: Please enter a valid email address.' ), 200 );
|
||||
return new WP_Error( 'require_valid_email', __( '<strong>Error</strong>: Please enter a valid email address.' ), 200 );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3379,7 +3379,7 @@ function wp_handle_comment_submission( $comment_data ) {
|
||||
*/
|
||||
$allow_empty_comment = apply_filters( 'allow_empty_comment', false, $commentdata );
|
||||
if ( '' === $comment_content && ! $allow_empty_comment ) {
|
||||
return new WP_Error( 'require_valid_comment', __( '<strong>ERROR</strong>: Please type a comment.' ), 200 );
|
||||
return new WP_Error( 'require_valid_comment', __( '<strong>Error</strong>: Please type a comment.' ), 200 );
|
||||
}
|
||||
|
||||
$check_max_lengths = wp_check_comment_data_max_lengths( $commentdata );
|
||||
@@ -3393,7 +3393,7 @@ function wp_handle_comment_submission( $comment_data ) {
|
||||
}
|
||||
|
||||
if ( ! $comment_id ) {
|
||||
return new WP_Error( 'comment_save_error', __( '<strong>ERROR</strong>: The comment could not be saved. Please try again later.' ), 500 );
|
||||
return new WP_Error( 'comment_save_error', __( '<strong>Error</strong>: The comment could not be saved. Please try again later.' ), 500 );
|
||||
}
|
||||
|
||||
return get_comment( $comment_id );
|
||||
|
||||
Reference in New Issue
Block a user