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.

git-svn-id: https://develop.svn.wordpress.org/trunk@46117 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2019-09-14 20:59:29 +00:00
parent 65b4c64440
commit 3ac6f6a8f8
4 changed files with 47 additions and 9 deletions

View File

@ -743,10 +743,19 @@ if ( ! function_exists( 'twentyeleven_comment' ) ) :
<?php edit_comment_link( __( 'Edit', 'twentyeleven' ), '<span class="edit-link">', '</span>' ); ?>
</div><!-- .comment-author .vcard -->
<?php if ( $comment->comment_approved == '0' ) : ?>
<em class="comment-awaiting-moderation"><?php _e( 'Your comment is awaiting moderation.', 'twentyeleven' ); ?></em>
<?php
$commenter = wp_get_current_commenter();
if ( $commenter['comment_author_email'] ) {
$moderation_note = __( 'Your comment is awaiting moderation.', 'twentyeleven' );
} else {
$moderation_note = __( 'Your comment is awaiting moderation. This is a preview, your comment will be visible after it has been approved.', 'twentyeleven' );
}
?>
<?php if ( '0' == $comment->comment_approved ) : ?>
<em class="comment-awaiting-moderation"><?php echo $moderation_note; ?></em>
<br />
<?php endif; ?>
<?php endif; ?>
</footer>

View File

@ -88,9 +88,19 @@ class TwentyNineteen_Walker_Comment extends Walker_Comment {
?>
</div><!-- .comment-metadata -->
<?php
$commenter = wp_get_current_commenter();
if ( $commenter['comment_author_email'] ) {
$moderation_note = __( 'Your comment is awaiting moderation.', 'twentynineteen' );
} else {
$moderation_note = __( 'Your comment is awaiting moderation. This is a preview, your comment will be visible after it has been approved.', 'twentynineteen' );
}
?>
<?php if ( '0' == $comment->comment_approved ) : ?>
<p class="comment-awaiting-moderation"><?php _e( 'Your comment is awaiting moderation.', 'twentynineteen' ); ?></p>
<p class="comment-awaiting-moderation"><?php echo $moderation_note; ?></p>
<?php endif; ?>
</footer><!-- .comment-meta -->
<div class="comment-content">

View File

@ -428,9 +428,19 @@ if ( ! function_exists( 'twentyten_comment' ) ) :
printf( __( '%s <span class="says">says:</span>', 'twentyten' ), sprintf( '<cite class="fn">%s</cite>', get_comment_author_link() ) );
?>
</div><!-- .comment-author .vcard -->
<?php if ( $comment->comment_approved == '0' ) : ?>
<em class="comment-awaiting-moderation"><?php _e( 'Your comment is awaiting moderation.', 'twentyten' ); ?></em>
<br />
<?php
$commenter = wp_get_current_commenter();
if ( $commenter['comment_author_email'] ) {
$moderation_note = __( 'Your comment is awaiting moderation.', 'twentyten' );
} else {
$moderation_note = __( 'Your comment is awaiting moderation. This is a preview, your comment will be visible after it has been approved.', 'twentyten' );
}
?>
<?php if ( '0' == $comment->comment_approved ) : ?>
<em class="comment-awaiting-moderation"><?php echo $moderation_note; ?></em>
<br />
<?php endif; ?>
<div class="comment-meta commentmetadata"><a href="<?php echo esc_url( get_comment_link( $comment->comment_ID ) ); ?>">

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(); ?>