WordPress.org

Make WordPress Core

Ticket #13820: garyc40-13820.patch

File garyc40-13820.patch, 2.8 KB (added by garyc40, 7 years ago)

there's a patch for that

  • wp-admin/includes/class-wp-comments-list-table.php

    diff --git wp-admin/includes/class-wp-comments-list-table.php wp-admin/includes/class-wp-comments-list-table.php
    index 16b5106..06a2286 100644
    class WP_Comments_List_Table extends WP_List_Table { 
    360360                <div class="author"><?php echo esc_attr( $comment->comment_author ); ?></div>
    361361                <div class="author-url"><?php echo esc_attr( $comment->comment_author_url ); ?></div>
    362362                <div class="comment_status"><?php echo $comment->comment_approved; ?></div>
     363                <div class="post-id"><?php echo $post->ID; ?></div>
    363364                </div>
    364365                <?php
    365366                }
  • wp-admin/includes/class-wp-list-table.php

    diff --git wp-admin/includes/class-wp-list-table.php wp-admin/includes/class-wp-list-table.php
    index a8aaa8f..13774a6 100644
    class WP_List_Table { 
    413413                if ( $pending_comments )
    414414                        echo '<strong>';
    415415
    416                 $link = "<a href='" . add_query_arg( 'p', $post_id, admin_url('edit-comments.php') ) . "' title='$pending_phrase' class='post-com-count'><span class='comment-count'>%s</span></a>";
     416                $link = "<a href='" . add_query_arg( 'p', $post_id, admin_url('edit-comments.php') ) . "' title='$pending_phrase' class='post-com-count'><span class='comment-count for-post-" . $post_id . "'>%s</span></a>";
    417417
    418418                comments_number(
    419419                        sprintf( $link, /* translators: comment count link */ _x( '0', 'comment count' ) ),
  • wp-admin/js/edit-comments.dev.js

    diff --git wp-admin/js/edit-comments.dev.js wp-admin/js/edit-comments.dev.js
    index 177dc86..9b8c1f3 100644
    setCommentsList = function() { 
    99        pageInput = $('.tablenav input[name="_page"]', '#comments-form');
    1010
    1111        dimAfter = function( r, settings ) {
    12                 var c = $('#' + settings.element);
     12                var c = $('#' + settings.element),
     13                        post_id = c.find('.post-id').text(),
     14                        dif = c.is('.' + settings.dimClass) ? -1 : 1,
     15                        bubble = $('span.comment-count.for-post-' + post_id),
     16                        bubble_count = bubble.eq(0).text() * 1;
    1317
    1418                if ( c.is('.unapproved') )
    1519                        c.find('div.comment_status').html('0')
    setCommentsList = function() { 
    1721                        c.find('div.comment_status').html('1')
    1822
    1923                $('span.pending-count').each( function() {
    20                         var a = $(this), n, dif;
     24                        var a = $(this), n;
    2125                        n = a.html().replace(/[^0-9]+/g, '');
    2226                        n = parseInt(n,10);
    2327                        if ( isNaN(n) ) return;
    24                         dif = $('#' + settings.element).is('.' + settings.dimClass) ? 1 : -1;
    25                         n = n + dif;
     28                        n = n - dif;
    2629                        if ( n < 0 ) { n = 0; }
    2730                        a.closest('#awaiting-mod')[ 0 == n ? 'addClass' : 'removeClass' ]('count-0');
    2831                        updateCount(a, n);
    2932                        dashboardTotals();
    3033                });
     34               
     35                bubble_count += dif;
     36                bubble.text(bubble_count);
    3137        };
    3238
    3339        // Send current total, page, per_page and url