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.

Built from https://develop.svn.wordpress.org/trunk@34132


git-svn-id: http://core.svn.wordpress.org/trunk@34100 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor 2015-09-14 22:24:26 +00:00
parent 60367d567d
commit 1a01a9ab55
2 changed files with 5 additions and 1 deletions

View File

@ -44,6 +44,8 @@ if ( $doaction ) {
$redirect_to = remove_query_arg( array( 'trashed', 'untrashed', 'deleted', 'spammed', 'unspammed', 'approved', 'unapproved', 'ids' ), wp_get_referer() );
$redirect_to = add_query_arg( 'paged', $pagenum, $redirect_to );
wp_defer_comment_counting( true );
foreach ( $comment_ids as $comment_id ) { // Check the permissions on each
if ( !current_user_can( 'edit_comment', $comment_id ) )
continue;
@ -80,6 +82,8 @@ if ( $doaction ) {
}
}
wp_defer_comment_counting( false );
if ( $approved )
$redirect_to = add_query_arg( 'approved', $approved, $redirect_to );
if ( $unapproved )

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.4-alpha-34131';
$wp_version = '4.4-alpha-34132';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.