Bundled Themes: 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 birgire, superpoincare.
Fixes #47461. See #43857.
Built from https://develop.svn.wordpress.org/trunk@46117


git-svn-id: http://core.svn.wordpress.org/trunk@45929 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2019-09-14 21:00:56 +00:00
parent c7b042d0ad
commit bfbbc3957f
1 changed files with 11 additions and 2 deletions

View File

@ -446,9 +446,18 @@ if ( ! function_exists( 'twentytwelve_comment' ) ) :
?>
</header><!-- .comment-meta -->
<?php
$commenter = wp_get_current_commenter();
if ( $commenter['comment_author_email'] ) {
$moderation_note = __( 'Your comment is awaiting moderation.', 'twentytwelve' );
} else {
$moderation_note = __( 'Your comment is awaiting moderation. This is a preview, your comment will be visible after it has been approved.', 'twentytwelve' );
}
?>
<?php if ( '0' == $comment->comment_approved ) : ?>
<p class="comment-awaiting-moderation"><?php _e( 'Your comment is awaiting moderation.', 'twentytwelve' ); ?></p>
<?php endif; ?>
<p class="comment-awaiting-moderation"><?php echo $moderation_note; ?></p>
<?php endif; ?>
<section class="comment-content comment">
<?php comment_text(); ?>