# wp_clean_themes_cache()

URL: https://chugunov.pro/api-wordpress/functions/wp_clean_themes_cache/
Проверено на WordPress 6.9, обновлено 06.08.2026.
Источник: независимый русскоязычный справочник chugunov.pro. Не является официальной документацией WordPress.

Тип: функция.
Появился в версии: 3.5.0.

## Сигнатура

```php
wp_clean_themes_cache( bool $clear_update_cache = true )
```

## Описание

Очищает кэш, хранимый get_theme_roots() и WP_Theme.

## Параметры

- `$clear_update_cache` `bool` — необязательный, по умолчанию `true`. Очищать ли кэш обновлений тем.

## Исходный код

Файл: `wp-includes/theme.php:142`

```php
function wp_clean_themes_cache( $clear_update_cache = true ) {
	if ( $clear_update_cache ) {
		delete_site_transient( 'update_themes' );
	}
	search_theme_directories( true );
	foreach ( wp_get_themes( array( 'errors' => null ) ) as $theme ) {
		$theme->cache_delete();
	}
}
```

## История изменений

- 3.5.0 — Introduced.

## Связанные

Использует: [`search_theme_directories`](https://chugunov.pro/api-wordpress/functions/search_theme_directories/), [`wp_get_themes`](https://chugunov.pro/api-wordpress/functions/wp_get_themes/), `WP_Theme`, [`delete_site_transient`](https://chugunov.pro/api-wordpress/functions/delete_site_transient/).
Используется в: [`wp_clean_update_cache`](https://chugunov.pro/api-wordpress/functions/wp_clean_update_cache/), `WP_Automatic_Updater::run`, `Theme_Upgrader::current_after`, `Theme_Upgrader::install`, `Theme_Upgrader::upgrade`, `Theme_Upgrader::bulk_upgrade`.

Оригинал в официальной документации: https://developer.wordpress.org/reference/functions/wp_clean_themes_cache/
