mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
Accept a post object in clean_post_cache(). Fixes #20486.
The post_type can then be accessed to properly clean the taxonomy relationships cache. The full object is useful in situations when an ID might reference a post that has been removed from the database (e.g. wp_delete_post()). git-svn-id: https://develop.svn.wordpress.org/trunk@20569 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1579,7 +1579,7 @@ function wp_update_comment_count_now($post_id) {
|
||||
$new = (int) $wpdb->get_var( $wpdb->prepare("SELECT COUNT(*) FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_approved = '1'", $post_id) );
|
||||
$wpdb->update( $wpdb->posts, array('comment_count' => $new), array('ID' => $post_id) );
|
||||
|
||||
clean_post_cache( $post_id, $post->post_type );
|
||||
clean_post_cache( $post );
|
||||
|
||||
do_action('wp_update_comment_count', $post_id, $new, $old);
|
||||
do_action('edit_post', $post_id, $post);
|
||||
|
||||
Reference in New Issue
Block a user