wppaste
WordPress

apply_filters( 'wp_should_output_buffer_template_for_enhancement', bool $use_output_buffer )

Since
6.9.0
Filters whether the template should be output-buffered for enhancement.

Description

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.

Compatibility

WordPress
since 6.9.0
  • 6.7.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in 3 of the 5 tracked releases, added in 6.9.0.

Parameters

$use_output_bufferbool
Whether an output buffer is started.

Where this hook fires · 1

  • wp-includes/template.php:857wp_should_output_buffer_template_for_enhancement()

Source code

	 * 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' ) );} /** * Starts the template enhancement output buffer. * * This function is called immediately before the template is included.

Changelog

Introduced in 6.9.0. Unchanged from 6.9.7 through 7.1.0.

  1. 6.9.7
  2. 7.0.4
  3. 7.1.0

Signature, return type and hooks compared across 3 parsed releases.

About this page

Parsed data
Generated from the wordpress-develop 7.1.0 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.