wpseek.com
Outil de recherche WordPress pour les développeurs et auteurs de thèmes



wp_theme_has_theme_json › WordPress Function

Depuis6.2.0
Dépréciéen/a
› wp_theme_has_theme_json ( Pas de paramètres )
Retourne:
  • (bool) Returns true if theme or its parent has a theme.json file, false otherwise.
Défini(e) dans:
Codex:

Checks whether a theme or its parent has a theme.json file.



Source

function wp_theme_has_theme_json() {
	static $theme_has_support = array();

	$stylesheet = get_stylesheet();

	if (
		isset( $theme_has_support[ $stylesheet ] ) &&
		/*
		 * Ignore static cache when the development mode is set to 'theme', to avoid interfering with
		 * the theme developer's workflow.
		 */
		! wp_is_development_mode( 'theme' )
	) {
		return $theme_has_support[ $stylesheet ];
	}

	$path = get_theme_file_path( 'theme.json' );

	$theme_has_support[ $stylesheet ] = file_exists( $path );

	return $theme_has_support[ $stylesheet ];
}