Make WordPress Core


Ignore:
Timestamp:
09/14/2015 10:03:23 PM (6 years ago)
Author:
wonderboymusic
Message:

The "counts" cache for comments by post id is never invalidated. Neither wp_update_comment_count() nor wp_update_comment_count_now() touch the cache.

Adds unit test.
See #33875.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/comment-functions.php

    r34130 r34131  
    19171917    clean_post_cache( $post );
    19181918
     1919    wp_cache_delete( "comments-{$post_id}", 'counts' );
     1920
    19191921    /**
    19201922     * Fires immediately after a post's comment count is updated in the database.
     
    23252327    foreach ( (array) $ids as $id ) {
    23262328        wp_cache_delete( $id, 'comment' );
    2327         wp_cache_delete( "comment-{$id}", 'counts' );
    23282329    }
    23292330
Note: See TracChangeset for help on using the changeset viewer.