wpseek.com
A WordPress-centric search engine for devs and theme authors
wp_template_enhancement_output_buffer › WordPress Filter Hooks
Since6.9.0
Deprecatedn/a
› apply_filters( 'wp_template_enhancement_output_buffer', $filtered_output, $output )
| Parameters: (2) |
|
| Defined at: |
|
| Codex: |
Filters the template enhancement output buffer prior to sending to the client.
This filter only applies the HTML output of an included template. This filter is a progressive enhancement intended for applications such as optimizing markup to improve frontend page load performance. Sites must not depend on this filter applying since they may opt to stream the responses instead. Callbacks for this filter are highly discouraged from using regular expressions to do any kind of replacement on the output. Use the HTML API (either `WP_HTML_Tag_Processor` or `WP_HTML_Processor`), or else use {@see \DOM\HtmlDocument} as of PHP 8.4 which fully supports HTML5. Do not print any output during this filter. While filters normally don't print anything, this is especially important since this applies during an output buffer callback. Prior to PHP 8.5, the output will be silently omitted, whereas afterward a deprecation notice will be emitted. Important: Because this filter is applied inside an output buffer callback (i.e. display handler), any callbacks added to the filter 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."Related Functions: wp_start_template_enhancement_output_buffer, wp_finalize_template_enhancement_output_buffer, wp_embed_handler_youtube, wp_get_environment_type, wp_update_comment_count, wp_get_attachment_thumb_url