Make WordPress Core

Changeset 34132


Ignore:
Timestamp:
09/14/2015 10:23:43 PM (6 years ago)
Author:
wonderboymusic
Message:

In the edit-comments.php admin handler, toggle wp_defer_comment_counting() so that only unique post IDs have their comment count updated. Currently, if you delete 50 comments from the same post, the count would get reset 50 times. Not joking.

See #33875.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/edit-comments.php

    r33860 r34132  
    4545    $redirect_to = add_query_arg( 'paged', $pagenum, $redirect_to );
    4646
     47    wp_defer_comment_counting( true );
     48
    4749    foreach ( $comment_ids as $comment_id ) { // Check the permissions on each
    4850        if ( !current_user_can( 'edit_comment', $comment_id ) )
     
    8082        }
    8183    }
     84
     85    wp_defer_comment_counting( false );
    8286
    8387    if ( $approved )
Note: See TracChangeset for help on using the changeset viewer.