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. Built from https://develop.svn.wordpress.org/trunk@44681 git-svn-id: http://core.svn.wordpress.org/trunk@44512 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
445209c9eb
commit
71e3633f3f
|
@ -263,6 +263,14 @@ class Walker_Comment extends Walker {
|
||||||
$tag = 'li';
|
$tag = 'li';
|
||||||
$add_below = 'div-comment';
|
$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.' );
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<<?php echo $tag; ?> <?php comment_class( $this->has_children ? 'parent' : '', $comment ); ?> id="comment-<?php comment_ID(); ?>">
|
<<?php echo $tag; ?> <?php comment_class( $this->has_children ? 'parent' : '', $comment ); ?> id="comment-<?php comment_ID(); ?>">
|
||||||
<?php if ( 'div' != $args['style'] ) : ?>
|
<?php if ( 'div' != $args['style'] ) : ?>
|
||||||
|
@ -282,7 +290,7 @@ class Walker_Comment extends Walker {
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
<?php if ( '0' == $comment->comment_approved ) : ?>
|
<?php if ( '0' == $comment->comment_approved ) : ?>
|
||||||
<em class="comment-awaiting-moderation"><?php _e( 'Your comment is awaiting moderation.' ); ?></em>
|
<em class="comment-awaiting-moderation"><?php echo $moderation_note; ?></em>
|
||||||
<br />
|
<br />
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
|
@ -345,6 +353,14 @@ class Walker_Comment extends Walker {
|
||||||
*/
|
*/
|
||||||
protected function html5_comment( $comment, $depth, $args ) {
|
protected function html5_comment( $comment, $depth, $args ) {
|
||||||
$tag = ( 'div' === $args['style'] ) ? 'div' : 'li';
|
$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.' );
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<<?php echo $tag; ?> id="comment-<?php comment_ID(); ?>" <?php comment_class( $this->has_children ? 'parent' : '', $comment ); ?>>
|
<<?php echo $tag; ?> id="comment-<?php comment_ID(); ?>" <?php comment_class( $this->has_children ? 'parent' : '', $comment ); ?>>
|
||||||
<article id="div-comment-<?php comment_ID(); ?>" class="comment-body">
|
<article id="div-comment-<?php comment_ID(); ?>" class="comment-body">
|
||||||
|
@ -376,7 +392,7 @@ class Walker_Comment extends Walker {
|
||||||
</div><!-- .comment-metadata -->
|
</div><!-- .comment-metadata -->
|
||||||
|
|
||||||
<?php if ( '0' == $comment->comment_approved ) : ?>
|
<?php if ( '0' == $comment->comment_approved ) : ?>
|
||||||
<p class="comment-awaiting-moderation"><?php _e( 'Your comment is awaiting moderation.' ); ?></p>
|
<em class="comment-awaiting-moderation"><?php echo $moderation_note; ?></em>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</footer><!-- .comment-meta -->
|
</footer><!-- .comment-meta -->
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '5.1-beta1-44680';
|
$wp_version = '5.1-beta1-44681';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue