WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

WP_Theme_JSON_Resolver::get_theme_data() public WP 5.8.0

Returns the theme's data.

Ищем WP-разработчика! Фулл-тайм, удаленка, хорошая зарплата, соц. пакет. Подробности.
Компания Boosta.

Data from theme.json can be augmented via the $theme_support_data variable. This is useful, for example, to backfill the gaps in theme.json that a theme has declared via add_theme_supports.

Note that if the same data is present in theme.json and in $theme_support_data, the theme.json's is not overwritten.

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

Хуков нет.

Возвращает

WP_Theme_JSON. Entity that holds theme data.

Использование

$result = WP_Theme_JSON_Resolver::get_theme_data( $theme_support_data );
$theme_support_data(массив)
Theme support data in theme.json format.
По умолчанию: empty array

Список изменений

С версии 5.8.0 Введена.

Код WP_Theme_JSON_Resolver::get_theme_data() WP 5.8.2

public static function get_theme_data( $theme_support_data = array() ) {
	if ( null === self::$theme ) {
		$theme_json_data = self::read_json_file( self::get_file_path_from_theme( 'theme.json' ) );
		$theme_json_data = self::translate( $theme_json_data, wp_get_theme()->get( 'TextDomain' ) );
		self::$theme     = new WP_Theme_JSON( $theme_json_data );
	}

	if ( empty( $theme_support_data ) ) {
		return self::$theme;
	}

	/*
	 * We want the presets and settings declared in theme.json
	 * to override the ones declared via add_theme_support.
	 */
	$with_theme_supports = new WP_Theme_JSON( $theme_support_data );
	$with_theme_supports->merge( self::$theme );

	return $with_theme_supports;
}