# wp_get_active_and_valid_themes()

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

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

## Сигнатура

```php
wp_get_active_and_valid_themes(): string[]
```

## Описание

Во время обновления или установки WordPress темы не возвращаются.

## Возвращаемое значение

`string[]`

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

Файл: `wp-includes/load.php:1096`

```php
function wp_get_active_and_valid_themes() {
	global $pagenow, $wp_stylesheet_path, $wp_template_path;

	$themes = array();

	if ( wp_installing() && 'wp-activate.php' !== $pagenow ) {
		return $themes;
	}

	if ( is_child_theme() ) {
		$themes[] = $wp_stylesheet_path;
	}

	$themes[] = $wp_template_path;

	/*
	 * Remove themes from the list of active themes when we're on an endpoint
	 * that should be protected against WSODs and the theme is paused.
	 */
	if ( wp_is_recovery_mode() ) {
		$themes = wp_skip_paused_themes( $themes );

		// If no active and valid themes exist, skip loading themes.
		if ( empty( $themes ) ) {
			add_filter( 'wp_using_themes', '__return_false' );
		}
	}

	return $themes;
}
```

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

- 5.1.0 — Introduced.

## Связанные

Использует: [`wp_is_recovery_mode`](https://chugunov.pro/api-wordpress/functions/wp_is_recovery_mode/), [`wp_skip_paused_themes`](https://chugunov.pro/api-wordpress/functions/wp_skip_paused_themes/), [`wp_installing`](https://chugunov.pro/api-wordpress/functions/wp_installing/), [`is_child_theme`](https://chugunov.pro/api-wordpress/functions/is_child_theme/), [`add_filter`](https://chugunov.pro/api-wordpress/functions/add_filter/).
Используется в: [`_register_theme_block_patterns`](https://chugunov.pro/api-wordpress/functions/_register_theme_block_patterns/).

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