mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-03-31 18:54:29 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@48115 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1243,19 +1243,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', __( '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', __( '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', __( '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', __( '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;
|
||||
@@ -3398,9 +3398,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', __( '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', __( 'Please enter a valid email address.' ), 200 );
|
||||
return new WP_Error( 'require_valid_email', __( '<strong>Error</strong>: Please enter a valid email address.' ), 200 );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3425,7 +3425,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', __( 'Please type your comment text.' ), 200 );
|
||||
return new WP_Error( 'require_valid_comment', __( '<strong>Error</strong>: Please type your comment text.' ), 200 );
|
||||
}
|
||||
|
||||
$check_max_lengths = wp_check_comment_data_max_lengths( $commentdata );
|
||||
@@ -3439,7 +3439,7 @@ function wp_handle_comment_submission( $comment_data ) {
|
||||
}
|
||||
|
||||
if ( ! $comment_id ) {
|
||||
return new WP_Error( 'comment_save_error', __( '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