# _add_block_template_info()

URL: https://chugunov.pro/api-wordpress/functions/_add_block_template_info/
Проверено на WordPress 6.9, обновлено 06.08.2026.
Источник: независимый русскоязычный справочник chugunov.pro. Не является официальной документацией WordPress.

Тип: функция.
Появился в версии: 5.9.0.

## Сигнатура

```php
_add_block_template_info( array $template_item ): array
```

## Описание

Пытается добавить сведения о произвольном шаблоне к элементу шаблона.

## Параметры

- `$template_item` `array` — обязательный. Шаблон, к которому добавляются сведения (требуется поле 'slug').

## Возвращаемое значение

`array`

## Исходный код

Файл: `wp-includes/block-template-utils.php:488`

```php
function _add_block_template_info( $template_item ) {
	if ( ! wp_theme_has_theme_json() ) {
		return $template_item;
	}

	$theme_data = wp_get_theme_data_custom_templates();
	if ( isset( $theme_data[ $template_item['slug'] ] ) ) {
		$template_item['title']     = $theme_data[ $template_item['slug'] ]['title'];
		$template_item['postTypes'] = $theme_data[ $template_item['slug'] ]['postTypes'];
	}

	return $template_item;
}
```

## История изменений

- 5.9.0 — Introduced.

## Связанные

Использует: [`wp_get_theme_data_custom_templates`](https://chugunov.pro/api-wordpress/functions/wp_get_theme_data_custom_templates/), [`wp_theme_has_theme_json`](https://chugunov.pro/api-wordpress/functions/wp_theme_has_theme_json/).
Используется в: [`_get_block_template_file`](https://chugunov.pro/api-wordpress/functions/_get_block_template_file/), [`_get_block_templates_files`](https://chugunov.pro/api-wordpress/functions/_get_block_templates_files/).

Оригинал в официальной документации: https://developer.wordpress.org/reference/functions/_add_block_template_info/
