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. git-svn-id: https://develop.svn.wordpress.org/trunk@34132 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
545da32217
commit
a9e1f79323
@ -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 = remove_query_arg( array( 'trashed', 'untrashed', 'deleted', 'spammed', 'unspammed', 'approved', 'unapproved', 'ids' ), wp_get_referer() );
|
||||||
$redirect_to = add_query_arg( 'paged', $pagenum, $redirect_to );
|
$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
|
foreach ( $comment_ids as $comment_id ) { // Check the permissions on each
|
||||||
if ( !current_user_can( 'edit_comment', $comment_id ) )
|
if ( !current_user_can( 'edit_comment', $comment_id ) )
|
||||||
continue;
|
continue;
|
||||||
@ -80,6 +82,8 @@ if ( $doaction ) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wp_defer_comment_counting( false );
|
||||||
|
|
||||||
if ( $approved )
|
if ( $approved )
|
||||||
$redirect_to = add_query_arg( 'approved', $approved, $redirect_to );
|
$redirect_to = add_query_arg( 'approved', $approved, $redirect_to );
|
||||||
if ( $unapproved )
|
if ( $unapproved )
|
||||||
|
Loading…
Reference in New Issue
Block a user