keycdn / cache-enabler

A lightweight caching plugin for WordPress that makes your website faster by generating static HTML files.
https://wordpress.org/plugins/cache-enabler/
123 stars 46 forks source link

update site cache clearing #180

Closed coreykn closed 3 years ago

coreykn commented 3 years ago

Update site cache clearing to switch to blog before site cache is cleared. In most cases we will already be in the current blog due to how the Cache_Enabler::each_site() method functions, but this will fix the known issue for multisite networks discussed in PR #170 where some cache cleared hooks would not be fired or the values would be empty. This would occur when using the WP-CLI clear subcommand with the --sites option or the public clear cache hooks like cache_enabler_clear_site_cache_by_blog_id when the blog ID being cleared is not the main site.