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.
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-CLIclear
subcommand with the--sites
option or the public clear cache hooks likecache_enabler_clear_site_cache_by_blog_id
when the blog ID being cleared is not the main site.