Opened 3 years ago
Last modified 2 years ago
#55454 new defect (bug)
clean_site_details_cache() doesn't clean all site caches
Reported by: | dd32 | Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | low |
Severity: | minor | Version: | 4.7 |
Component: | Networks and Sites | Keywords: | |
Focuses: | multisite | Cc: |
Description
clean_site_details_cache() clear's two caches:
wp_cache_delete( $site_id, 'site-details' ); wp_cache_delete( $site_id, 'blog-details' );
But there's a third used within get_blog_details()
that's closely related to those two caches:
if ( $get_all ) { $details = wp_cache_get( $blog_id . 'short', 'blog-details' ); } else { $details = wp_cache_get( $blog_id, 'blog-details' );
One could argue that the blog-details
caches are not related to the site-details
caches, but one would expect that if it clears some of them, that it'll clear all of them.
clean_blog_cache()
is a much more comprehensive function though:
wp_cache_delete( $blog_id, 'sites' ); wp_cache_delete( $blog_id, 'site-details' ); wp_cache_delete( $blog_id, 'blog-details' ); wp_cache_delete( $blog_id . 'short', 'blog-details' ); wp_cache_delete( $domain_path_key, 'blog-lookup' ); wp_cache_delete( $domain_path_key, 'blog-id-cache' ); wp_cache_delete( $blog_id, 'blog_meta' );
Note: See
TracTickets for help on using
tickets.
#55455 was marked as a duplicate.