функция since 5.1.0

wp_get_active_and_valid_themes()

Проверено на WordPress 6.9, обновлено Источник: WordPress Developer Resources.

Сигнатура

wp_get_active_and_valid_themes(): string[]

Описание

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

Оригинал (английский)

While upgrading or installing WordPress, no themes are returned.

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

string[]

Исходный код

wp-includes/load.php:1096

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.

Что будем искать? Например,Продвижение

Этот сайт использует куки-файлы. Оставаясь на сайте, Вы соглашаетесь на их использование. Для получения дополнительной информации, пожалуйста, ознакомьтесь с политикой в отношении персональных данных.