mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@34131 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1916,6 +1916,8 @@ function wp_update_comment_count_now($post_id) {
|
||||
|
||||
clean_post_cache( $post );
|
||||
|
||||
wp_cache_delete( "comments-{$post_id}", 'counts' );
|
||||
|
||||
/**
|
||||
* Fires immediately after a post's comment count is updated in the database.
|
||||
*
|
||||
@@ -2324,7 +2326,6 @@ function xmlrpc_pingback_error( $ixr_error ) {
|
||||
function clean_comment_cache($ids) {
|
||||
foreach ( (array) $ids as $id ) {
|
||||
wp_cache_delete( $id, 'comment' );
|
||||
wp_cache_delete( "comment-{$id}", 'counts' );
|
||||
}
|
||||
|
||||
wp_cache_set( 'last_changed', microtime(), 'comment' );
|
||||
|
||||
Reference in New Issue
Block a user