wp_get_theme_data_custom_templates()WP 6.4.0

Returns the metadata for the custom templates defined by the theme via theme.json.

Хуков нет.

Возвращает

Массив. Associative array of $template_name => $template_data pairs, with $template_data having "title" and "postTypes" fields.

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

wp_get_theme_data_custom_templates();

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

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

Код wp_get_theme_data_custom_templates() WP 6.6.2

function wp_get_theme_data_custom_templates() {
	return WP_Theme_JSON_Resolver::get_theme_data( array(), array( 'with_supports' => false ) )->get_custom_templates();
}