Properly update pagination links when moderating comments for a particular post or page.

git-svn-id: http://svn.automattic.com/wordpress/trunk@12399 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
azaozz 2009-12-15 04:33:16 +00:00
parent 2c4aadf49f
commit afdd8d229a
1 changed files with 4 additions and 1 deletions

View File

@ -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 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() ); die( (string) time() );
$post_id = 0;
$status = 'total_comments'; // What type of comment count are we looking for? $status = 'total_comments'; // What type of comment count are we looking for?
$parsed = parse_url( $url ); $parsed = parse_url( $url );
if ( isset( $parsed['query'] ) ) { if ( isset( $parsed['query'] ) ) {
parse_str( $parsed['query'], $query_vars ); parse_str( $parsed['query'], $query_vars );
if ( !empty( $query_vars['comment_status'] ) ) if ( !empty( $query_vars['comment_status'] ) )
$status = $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 $time = time(); // The time since the last comment count
if ( isset( $comment_count->$status ) ) // We're looking for a known type of comment count if ( isset( $comment_count->$status ) ) // We're looking for a known type of comment count