# _block_template_render_without_post_block_context()

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

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

## Сигнатура

```php
_block_template_render_without_post_block_context( array $context ): array
```

## Описание

Удаляет сведения о записи из контекста блока при отображении блочного шаблона.

## Параметры

- `$context` `array` — обязательный. Контекст по умолчанию.

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

`array`

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

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

```php
function _block_template_render_without_post_block_context( $context ) {
	/*
	 * When loading a template directly and not through a page that resolves it,
	 * the top-level post ID and type context get set to that of the template.
	 * Templates are just the structure of a site, and they should not be available
	 * as post context because blocks like Post Content would recurse infinitely.
	 */
	if ( isset( $context['postType'] ) && 'wp_template' === $context['postType'] ) {
		unset( $context['postId'] );
		unset( $context['postType'] );
	}

	return $context;
}
```

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

- 5.8.0 — Introduced.

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