Changeset 3888
- Timestamp:
- 06/19/2006 05:18:19 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.0/wp-includes/comment-functions.php
r3873 r3888 222 222 223 223 $post_id = $comment->comment_post_ID; 224 if ( $post_id && $comment->comment_approved == 1 ) 225 $wpdb->query( "UPDATE $wpdb->posts SET comment_count = comment_count - 1 WHERE ID = '$post_id'" ); 224 if ( $post_id && $comment->comment_approved == 1 ) { 225 $count = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->comments WHERE comment_post_ID = '$post_id' AND comment_approved = '1'"); 226 $wpdb->query( "UPDATE $wpdb->posts SET comment_count = $count WHERE ID = '$post_id'" ); 227 } 226 228 227 229 do_action('wp_set_comment_status', $comment_id, 'delete');
Note: See TracChangeset
for help on using the changeset viewer.