# _build_template_result_from_post()

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

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

## Сигнатура

```php
_build_template_result_from_post( WP_Post $post ): WP_Block_Template|WP_Error
```

## Описание

Строит унифицированный объект шаблона на основе объекта записи.

## Параметры

- `$post` `WP_Post` — обязательный. Запись шаблона.

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

`WP_Block_Template|WP_Error`

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

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

```php
if ( ! defined( 'WP_TEMPLATE_PART_AREA_UNCATEGORIZED' ) ) {
	define( 'WP_TEMPLATE_PART_AREA_UNCATEGORIZED', 'uncategorized' );
}
if ( ! defined( 'WP_TEMPLATE_PART_AREA_NAVIGATION_OVERLAY' ) ) {
	define( 'WP_TEMPLATE_PART_AREA_NAVIGATION_OVERLAY', 'navigation-overlay' );
}

/**
 * For backward compatibility reasons,
 * block themes might be using block-templates or block-template-parts,
 * this function ensures we fallback to these folders properly.
 *
 * @since 5.9.0
 *
 * @param string $theme_stylesheet The stylesheet. Default is to leverage the main theme root.
 *
 * @return string[] {
 *     Folder names used by block themes.
 *
 *     @type string $wp_template      Theme-relative directory name for block templates.
 *     @type string $wp_template_part Theme-relative directory name for block template parts.
 * }
 */
function get_block_theme_folders( $theme_stylesheet = null ) {
	$theme = wp_get_theme( (string) $theme_stylesheet );
	if ( ! $theme->exists() ) {
		// Return the default folders if the theme doesn't exist.
		return array(
```

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

- 5.8.0 — Introduced.

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