From c74cd320fa497f9a6f3ea6759b00f963ea7b71f6 Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Tue, 15 Dec 2009 04:33:16 +0000 Subject: [PATCH] Properly update pagination links when moderating comments for a particular post or page. git-svn-id: https://develop.svn.wordpress.org/trunk@12399 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/admin-ajax.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wp-admin/admin-ajax.php b/wp-admin/admin-ajax.php index ba2b20ba2b..ae9c81dcd5 100644 --- a/wp-admin/admin-ajax.php +++ b/wp-admin/admin-ajax.php @@ -162,15 +162,18 @@ function _wp_ajax_delete_comment_response( $comment_id ) { if ( 0 != $total % $per_page && 1 != mt_rand( 1, $per_page ) ) // Only do the expensive stuff on a page-break, and about 1 other time per page die( (string) time() ); + $post_id = 0; $status = 'total_comments'; // What type of comment count are we looking for? $parsed = parse_url( $url ); if ( isset( $parsed['query'] ) ) { parse_str( $parsed['query'], $query_vars ); if ( !empty( $query_vars['comment_status'] ) ) $status = $query_vars['comment_status']; + if ( !empty( $query_vars['p'] ) ) + $post_id = (int) $query_vars['p']; } - $comment_count = wp_count_comments(); + $comment_count = wp_count_comments($post_id); $time = time(); // The time since the last comment count if ( isset( $comment_count->$status ) ) // We're looking for a known type of comment count