# _add_block_template_part_area_info()

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

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

## Сигнатура

```php
_add_block_template_part_area_info( array $template_info ): array
```

## Описание

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

## Параметры

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

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

`array`

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

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

```php
function _add_block_template_part_area_info( $template_info ) {
	if ( wp_theme_has_theme_json() ) {
		$theme_data = wp_get_theme_data_template_parts();
	}

	if ( isset( $theme_data[ $template_info['slug'] ]['area'] ) ) {
		$template_info['title'] = $theme_data[ $template_info['slug'] ]['title'];
		$template_info['area']  = _filter_block_template_part_area( $theme_data[ $template_info['slug'] ]['area'] );
	} else {
		$template_info['area'] = WP_TEMPLATE_PART_AREA_UNCATEGORIZED;
	}

	return $template_info;
}
```

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

- 5.9.0 — Introduced.

## Связанные

Использует: [`wp_get_theme_data_template_parts`](https://chugunov.pro/api-wordpress/functions/wp_get_theme_data_template_parts/), [`wp_theme_has_theme_json`](https://chugunov.pro/api-wordpress/functions/wp_theme_has_theme_json/), [`_filter_block_template_part_area`](https://chugunov.pro/api-wordpress/functions/_filter_block_template_part_area/).
Используется в: [`_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_part_area_info/
