WP_Theme_JSON_Resolver::theme_has_support()public staticWP 5.8.0

Determines whether the active theme has a theme.json file.

Метод класса: WP_Theme_JSON_Resolver{}

No Hooks.

Return

true|false.

Usage

$result = WP_Theme_JSON_Resolver::theme_has_support();

Changelog

Since 5.8.0 Introduced.
Since 5.9.0 Added a check in the parent theme.

Код WP_Theme_JSON_Resolver::theme_has_support() WP 6.1.1

public static function theme_has_support() {
	if ( ! isset( static::$theme_has_support ) ) {
		static::$theme_has_support = (
			static::get_file_path_from_theme( 'theme.json' ) !== '' ||
			static::get_file_path_from_theme( 'theme.json', true ) !== ''
		);
	}

	return static::$theme_has_support;
}