From db4f7455811779470f56685041977151e302751a Mon Sep 17 00:00:00 2001 From: Gary Pendergast Date: Mon, 21 Jan 2019 22:45:51 +0000 Subject: [PATCH] Comments: Update the message shown when a comment is awaiting moderation. If the commenter doesn't have cookies set, they won't see the comment preview again. Showing an expanded message will help offset any confusion if they revisit the site later, and their comment is still in moderation, but they can't see it anymore. Props azaozz, pento. Fixes #44736. git-svn-id: https://develop.svn.wordpress.org/trunk@44681 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/class-walker-comment.php | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/wp-includes/class-walker-comment.php b/src/wp-includes/class-walker-comment.php index 5bfcac0ed3..87834f52be 100644 --- a/src/wp-includes/class-walker-comment.php +++ b/src/wp-includes/class-walker-comment.php @@ -263,6 +263,14 @@ class Walker_Comment extends Walker { $tag = 'li'; $add_below = 'div-comment'; } + + $commenter = wp_get_current_commenter(); + if ( $commenter['comment_author_email'] ) { + $moderation_note = __( 'Your comment is awaiting moderation.' ); + } else { + $moderation_note = __( 'Your comment is awaiting moderation. This is a preview, your comment will be visible after it has been approved.' ); + } + ?> < has_children ? 'parent' : '', $comment ); ?> id="comment-"> @@ -282,7 +290,7 @@ class Walker_Comment extends Walker { ?> comment_approved ) : ?> - +
@@ -345,6 +353,14 @@ class Walker_Comment extends Walker { */ protected function html5_comment( $comment, $depth, $args ) { $tag = ( 'div' === $args['style'] ) ? 'div' : 'li'; + + $commenter = wp_get_current_commenter(); + if ( $commenter['comment_author_email'] ) { + $moderation_note = __( 'Your comment is awaiting moderation.' ); + } else { + $moderation_note = __( 'Your comment is awaiting moderation. This is a preview, your comment will be visible after it has been approved.' ); + } + ?> < id="comment-" has_children ? 'parent' : '', $comment ); ?>>
@@ -376,7 +392,7 @@ class Walker_Comment extends Walker { comment_approved ) : ?> -

+