wordpress / latest / classes / wp_theme_json_resolver / theme_has_support.html

WP_Theme_JSON_Resolver::theme_has_support(): bool

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

Return

bool

Source

File: wp-includes/class-wp-theme-json-resolver.php. View all references

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

	return static::$theme_has_support;
}

Used By

Used By Description

Changelog

Version Description
5.9.0 Added a check in the parent theme.
5.8.0 Introduced.

© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_theme_json_resolver/theme_has_support