WordPress.org

Make WordPress Core


Ignore:
Timestamp:
09/14/2019 08:59:29 PM (2 years ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentytwelve/functions.php

    r45932 r46117  
    447447                </header><!-- .comment-meta -->
    448448
     449                <?php
     450                $commenter = wp_get_current_commenter();
     451                if ( $commenter['comment_author_email'] ) {
     452                    $moderation_note = __( 'Your comment is awaiting moderation.', 'twentytwelve' );
     453                } else {
     454                    $moderation_note = __( 'Your comment is awaiting moderation. This is a preview, your comment will be visible after it has been approved.', 'twentytwelve' );
     455                }
     456                ?>
     457
    449458                <?php if ( '0' == $comment->comment_approved ) : ?>
    450                 <p class="comment-awaiting-moderation"><?php _e( 'Your comment is awaiting moderation.', 'twentytwelve' ); ?></p>
    451             <?php endif; ?>
     459                <p class="comment-awaiting-moderation"><?php echo $moderation_note; ?></p>
     460                <?php endif; ?>
    452461
    453462                <section class="comment-content comment">
Note: See TracChangeset for help on using the changeset viewer.