# wp_should_output_buffer_template_for_enhancement()

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

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

## Сигнатура

```php
wp_should_output_buffer_template_for_enhancement(): bool
```

## Описание

По умолчанию буфер вывода запускается только в том случае, если фильтр ‘wp_template_enhancement_output_buffer’ был добавлен к моменту подключения шаблона в действии ‘wp_before_include_template’. Это позволяет по возможности передавать ответы шаблонов потоком, когда не зарегистрировано ни одного улучшения шаблона для применения.

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

`bool`

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

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

```php
function wp_should_output_buffer_template_for_enhancement(): bool {
	/**
	 * Filters whether the template should be output-buffered for enhancement.
	 *
	 * By default, an output buffer is only started if a 'wp_template_enhancement_output_buffer' filter has been
	 * added or if a plugin has added a 'wp_finalized_template_enhancement_output_buffer' action. For this
	 * default to apply, either of the hooks must be added by the time the template is included at the
	 * 'wp_before_include_template' action. This allows template responses to be streamed unless the there is
	 * code which depends on an output buffer being opened. This filter allows a site to opt in to adding such template
	 * enhancement filters later during the rendering of the template.
	 *
	 * @since 6.9.0
	 *
	 * @param bool $use_output_buffer Whether an output buffer is started.
	 */
	return (bool) apply_filters( 'wp_should_output_buffer_template_for_enhancement', has_filter( 'wp_template_enhancement_output_buffer' ) || has_action( 'wp_finalized_template_enhancement_output_buffer' ) );
}
```

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

- 6.9.0 — Introduced.

## Связанные

Использует: [`has_action`](https://chugunov.pro/api-wordpress/functions/has_action/), [`has_filter`](https://chugunov.pro/api-wordpress/functions/has_filter/), [`apply_filters`](https://chugunov.pro/api-wordpress/functions/apply_filters/).
Используется в: [`wp_load_classic_theme_block_styles_on_demand`](https://chugunov.pro/api-wordpress/functions/wp_load_classic_theme_block_styles_on_demand/), [`wp_start_template_enhancement_output_buffer`](https://chugunov.pro/api-wordpress/functions/wp_start_template_enhancement_output_buffer/).

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