Fires after the template enhancement output buffer has been finalized.
Description
This happens immediately before the template enhancement output buffer is flushed. No output may be printed at this action; prior to PHP 8.5, the output will be silently omitted, whereas afterward a deprecation notice will be emitted. Nevertheless, HTTP headers may be sent, which makes this action complimentary to the ‘send_headers’ action, in which headers may be sent before the template has started rendering. In contrast, this wp_finalized_template_enhancement_output_buffer action is the possible point at which HTTP headers can be sent. This action does not fire if the “template enhancement output buffer” was not started.
This output buffer is automatically started if this action is added before wp_start_template_enhancement_output_buffer() runs at the ‘wp_before_include_template’ action with priority 1000. Before this point, the output buffer will also be started automatically if there was a ‘wp_template_enhancement_output_buffer’ filter added, or if the ‘wp_should_output_buffer_template_for_enhancement’ filter is made to return true.
Important: Because this action fires inside an output buffer callback (i.e. display handler), any callbacks added to the action must not attempt to start their own output buffers. Otherwise, PHP will raise a fatal error: “Cannot use output buffering in output buffering display handlers.”
Parameters
$outputstring- Finalized output buffer.
Source
do_action( 'wp_finalized_template_enhancement_output_buffer', $filtered_output );
Changelog
| Version | Description |
|---|---|
| 6.9.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.