Make WordPress Core

Ticket #43857: 43857.12.diff

File 43857.12.diff, 2.0 KB (added by azaozz, 6 years ago)
  • src/wp-includes/class-walker-comment.php

     
    263263                        $tag       = 'li';
    264264                        $add_below = 'div-comment';
    265265                }
     266
     267                $commenter = wp_get_current_commenter();
     268
    266269                ?>
    267270                <<?php echo $tag; ?> <?php comment_class( $this->has_children ? 'parent' : '', $comment ); ?> id="comment-<?php comment_ID(); ?>">
    268271                <?php if ( 'div' != $args['style'] ) : ?>
     
    282285                        ?>
    283286                </div>
    284287                <?php if ( '0' == $comment->comment_approved ) : ?>
    285                 <em class="comment-awaiting-moderation"><?php _e( 'Your comment is awaiting moderation.' ); ?></em>
     288                <em class="comment-awaiting-moderation">
     289                        <?php _e( 'Your comment is awaiting moderation.' ); ?>
     290                        <?php
     291                                if ( empty( $commenter['comment_author_email'] ) ) {
     292                                        _e( 'It is visible only to you and only after it is posted.' );
     293                                }
     294                        ?>
     295                </em>
    286296                <br />
    287297                <?php endif; ?>
    288298
     
    345355         */
    346356        protected function html5_comment( $comment, $depth, $args ) {
    347357                $tag = ( 'div' === $args['style'] ) ? 'div' : 'li';
     358                $commenter = wp_get_current_commenter();
     359
    348360                ?>
    349361                <<?php echo $tag; ?> id="comment-<?php comment_ID(); ?>" <?php comment_class( $this->has_children ? 'parent' : '', $comment ); ?>>
    350362                        <article id="div-comment-<?php comment_ID(); ?>" class="comment-body">
     
    376388                                        </div><!-- .comment-metadata -->
    377389
    378390                                        <?php if ( '0' == $comment->comment_approved ) : ?>
    379                                         <p class="comment-awaiting-moderation"><?php _e( 'Your comment is awaiting moderation.' ); ?></p>
     391                                        <p class="comment-awaiting-moderation">
     392                                                <?php _e( 'Your comment is awaiting moderation.' ); ?>
     393                                                <?php
     394                                                        if ( empty( $commenter['comment_author_email'] ) ) {
     395                                                                _e( 'It is visible only to you and only after it is posted.' );
     396                                                        }
     397                                                ?>
     398                                        </p>
    380399                                        <?php endif; ?>
    381400                                </footer><!-- .comment-meta -->
    382401