Remove old comment_count_cache variable. It's dead.
git-svn-id: http://svn.automattic.com/wordpress/trunk@6348 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
aa60ae297d
commit
5c07742cd3
|
@ -497,7 +497,7 @@ function wp_update_comment($commentarr) {
|
||||||
|
|
||||||
|
|
||||||
function wp_update_comment_count($post_id) {
|
function wp_update_comment_count($post_id) {
|
||||||
global $wpdb, $comment_count_cache;
|
global $wpdb;
|
||||||
$post_id = (int) $post_id;
|
$post_id = (int) $post_id;
|
||||||
if ( !$post_id )
|
if ( !$post_id )
|
||||||
return false;
|
return false;
|
||||||
|
@ -507,7 +507,6 @@ function wp_update_comment_count($post_id) {
|
||||||
$old = (int) $post->comment_count;
|
$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'");
|
$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'");
|
$wpdb->query("UPDATE $wpdb->posts SET comment_count = '$new' WHERE ID = '$post_id'");
|
||||||
$comment_count_cache[$post_id] = $new;
|
|
||||||
|
|
||||||
if ( 'page' == $post->post_type )
|
if ( 'page' == $post->post_type )
|
||||||
clean_page_cache( $post_id );
|
clean_page_cache( $post_id );
|
||||||
|
|
Loading…
Reference in New Issue