WordPress.org

Make WordPress Core

Ticket #21879: destroy_posts_count_cache.patch

File destroy_posts_count_cache.patch, 847 bytes (added by mark8barnes, 6 years ago)
  • wp-includes/post.php

    old new  
    20902090                foreach ( (array) $children as $child )
    20912091                        clean_post_cache( $child );
    20922092        }
     2093       
     2094        wp_cache_delete ($post->post_type, 'counts');
    20932095
    20942096        wp_clear_scheduled_hook('publish_future_post', array( $postid ) );
    20952097
     
    21312133
    21322134        wp_trash_post_comments($post_id);
    21332135
     2136        wp_cache_delete ($post['post_type'], 'counts');
     2137
    21342138        do_action('trashed_post', $post_id);
    21352139
    21362140        return $post;
     
    30243028        do_action('transition_post_status', $new_status, $old_status, $post);
    30253029        do_action("{$old_status}_to_{$new_status}", $post);
    30263030        do_action("{$new_status}_{$post->post_type}", $post->ID, $post);
     3031        wp_cache_delete ($post->post_type, 'counts');
     3032
    30273033}
    30283034
    30293035//