Remove old comment_count_cache variable. It's dead.

git-svn-id: https://develop.svn.wordpress.org/trunk@6348 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2007-11-29 05:03:25 +00:00
parent eab6b80195
commit 376e2d98af
1 changed files with 1 additions and 2 deletions

View File

@ -497,7 +497,7 @@ function wp_update_comment($commentarr) {
function wp_update_comment_count($post_id) {
global $wpdb, $comment_count_cache;
global $wpdb;
$post_id = (int) $post_id;
if ( !$post_id )
return false;
@ -507,7 +507,6 @@ function wp_update_comment_count($post_id) {
$old = (int) $post->comment_count;
$new = (int) $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->comments WHERE comment_post_ID = '$post_id' AND comment_approved = '1'");
$wpdb->query("UPDATE $wpdb->posts SET comment_count = '$new' WHERE ID = '$post_id'");
$comment_count_cache[$post_id] = $new;
if ( 'page' == $post->post_type )
clean_page_cache( $post_id );