/** * Invalidate storage for cache types queued to clear. */ public static function clear_queued() { if (self::$clear_all) { WPSEO_Sitemaps_Cache_Validator::invalidate_storage(); self::$clear_all = false; self::$clear_types = array(); return; } foreach (self::$clear_types as $type) { WPSEO_Sitemaps_Cache_Validator::invalidate_storage($type); } self::$clear_types = array(); }
/** * Delete cache transients for given sitemaps types or all by default. * * @param array $types Set of sitemap types to delete cache transients for. * * @return void */ public static function clear($types = array()) { // No types provided, clear all. if (empty($types)) { WPSEO_Sitemaps_Cache_Validator::invalidate_storage(); return; } // Always invalidate the index sitemap as well. if (!in_array(WPSEO_Sitemaps::SITEMAP_INDEX_TYPE, $types)) { array_unshift($types, WPSEO_Sitemaps::SITEMAP_INDEX_TYPE); } foreach ($types as $type) { WPSEO_Sitemaps_Cache_Validator::invalidate_storage($type); } }