Make WordPress Core


Ignore:
Timestamp:
09/24/2015 03:52:41 PM (10 years ago)
Author:
wonderboymusic
Message:

Comments: update Comment counts dynamically in the Right Now widget based on moderation actions in the Activity widget.

Fixes #10422.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/dashboard.php

    r34382 r34500  
    260260        <li class="comment-count"><a href="edit-comments.php"><?php echo $text; ?></a></li>
    261261        <?php
    262         if ( $num_comm->moderated ) {
    263             /* translators: Number of comments in moderation */
    264             $text = sprintf( _nx( '%s in moderation', '%s in moderation', $num_comm->moderated, 'comments' ), number_format_i18n( $num_comm->moderated ) );
    265             ?>
    266             <li class="comment-mod-count"><a href="edit-comments.php?comment_status=moderated"><?php echo $text; ?></a></li>
    267             <?php
    268         }
     262        /* translators: Number of comments in moderation */
     263        $text = sprintf( _nx( '%s in moderation', '%s in moderation', $num_comm->moderated, 'comments' ), number_format_i18n( $num_comm->moderated ) );
     264        ?>
     265        <li class="comment-mod-count<?php
     266            if ( ! $num_comm->moderated ) {
     267                echo ' hidden';
     268            }
     269        ?>"><a href="edit-comments.php?comment_status=moderated"><?php echo $text; ?></a></li>
     270        <?php
    269271    }
    270272
     
    555557 */
    556558function _wp_dashboard_recent_comments_row( &$comment, $show_date = true ) {
    557     $GLOBALS['comment'] =& $comment;
     559    $GLOBALS['comment'] = clone $comment;
    558560
    559561    if ( $comment->comment_post_ID > 0 && current_user_can( 'edit_post', $comment->comment_post_ID ) ) {
Note: See TracChangeset for help on using the changeset viewer.