mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
In _wp_ajax_delete_comment_response(), read the new 'all' prop returned by get_comment_count() via wp_count_comments() when setting $total. 'all' doesn't include spam in its count.
Updates unit tests. Props dipesh.kakadiya. Fixes #32362. git-svn-id: https://develop.svn.wordpress.org/trunk@34161 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -362,6 +362,7 @@ function get_comment_count( $post_id = 0 ) {
|
||||
'trash' => 0,
|
||||
'post-trashed' => 0,
|
||||
'total_comments' => 0,
|
||||
'all' => 0,
|
||||
);
|
||||
|
||||
foreach ( $totals as $row ) {
|
||||
@@ -379,10 +380,12 @@ function get_comment_count( $post_id = 0 ) {
|
||||
case '1':
|
||||
$comment_count['approved'] = $row['total'];
|
||||
$comment_count['total_comments'] += $row['total'];
|
||||
$comment_count['all'] += $row['total'];
|
||||
break;
|
||||
case '0':
|
||||
$comment_count['awaiting_moderation'] = $row['total'];
|
||||
$comment_count['total_comments'] += $row['total'];
|
||||
$comment_count['all'] += $row['total'];
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user