public static function clear_on_theme_changes() { static $once = false; /* Only clear once. */ global $pagenow; /* Holds the current page filename. */ global $current_site, $current_blog; /* Need these for Multisite details. */ /**/ do_action("ws_plugin__qcache_before_clear_on_theme_changes", get_defined_vars()); /**/ if (c_ws_plugin__qcache_utils_conds::is_blog_admin() && in_array($pagenow, $pages = array("themes.php"))) { if (!$once && ($once = true)) { if (is_multisite() && is_object($current_blog) && $current_blog->blog_id) { c_ws_plugin__qcache_purging_routines::schedule_cache_dir_purge($current_blog); /**/ if (!is_multisite() || !c_ws_plugin__qcache_utils_conds::is_multisite_farm() || is_main_site()) { $notice = 'Blog# <code>' . esc_html($current_blog->blog_id) . '</code> : Quick Cache reset automatically to avoid conflicts :-)'; c_ws_plugin__qcache_admin_notices::enqueue_admin_notice($notice, $pages); } } else { c_ws_plugin__qcache_purging_routines::schedule_cache_dir_purge(); /**/ if (!is_multisite() || !c_ws_plugin__qcache_utils_conds::is_multisite_farm() || is_main_site()) { $notice = 'Quick Cache reset automatically to avoid conflicts :-)'; c_ws_plugin__qcache_admin_notices::enqueue_admin_notice($notice, $pages); } } /**/ do_action("ws_plugin__qcache_during_clear_on_theme_changes", get_defined_vars()); } } /**/ do_action("ws_plugin__qcache_after_clear_on_theme_changes", get_defined_vars()); /**/ return; /* Return for uniformity. */ }