WPSEO_Sitemaps_Cache_Validator::invalidate_storage
Invalidate sitemap cache.
Метод класса: WPSEO_Sitemaps_Cache_Validator{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
$result = WPSEO_Sitemaps_Cache_Validator::invalidate_storage( $type );
- $type(строка|null)
- The type to get the key for. Null for all caches.
По умолчанию:null
Список изменений
| С версии 3.2 | Введена. |
Код WPSEO_Sitemaps_Cache_Validator::invalidate_storage() WPSEO Sitemaps Cache Validator::invalidate storage Yoast 27.8
public static function invalidate_storage( $type = null ) {
// Global validator gets cleared when no type is provided.
$old_validator = null;
// Get the current type validator.
if ( $type !== null ) {
$old_validator = self::get_validator( $type );
}
// Refresh validator.
self::create_validator( $type );
if ( ! wp_using_ext_object_cache() ) {
// Clean up current cache from the database.
self::cleanup_database( $type, $old_validator );
}
// External object cache pushes old and unretrieved items out by itself so we don't have to do anything for that.
}