[wp-trac] [WordPress Trac] #43258: Output buffer template rendering and add filter for post-processing (e.g. caching, optimization)

WordPress Trac noreply at wordpress.org
Tue Nov 4 05:26:59 UTC 2025


#43258: Output buffer template rendering and add filter for post-processing (e.g.
caching, optimization)
-------------------------------------------------+-------------------------
 Reporter:  nextendweb                           |       Owner:
                                                 |  westonruter
     Type:  enhancement                          |      Status:  closed
 Priority:  normal                               |   Milestone:  6.9
Component:  General                              |     Version:
 Severity:  normal                               |  Resolution:  fixed
 Keywords:  has-patch has-unit-tests dev-        |     Focuses:  docs,
  feedback needs-dev-note                        |  performance
-------------------------------------------------+-------------------------

Comment (by westonruter):

 In [changeset:"61120" 61120]:
 {{{
 #!CommitTicketReference repository="" revision="61120"
 General: Ensure errors can be displayed when triggered during finalization
 of the template enhancement output buffer.

 When `display_errors` (`WP_DEBUG_DISPLAY`) is enabled, errors (including
 notices, warnings, and deprecations) that are triggered during the
 `wp_template_enhancement_output_buffer` filter or the
 `wp_finalized_template_enhancement_output_buffer` action have not been
 displayed on the frontend since they are emitted in an output buffer
 callback. Furthermore, as of PHP 8.5 attempting to print anything in an
 output buffer callback causes a deprecation notice. This introduces an
 error handler and try/catch block to capture any errors and exceptions
 that occur during these hooks. If `display_errors` is enabled, these
 captured errors are then appended to the output buffer so they are visible
 on the frontend, using the same internal format PHP uses for printing
 errors. Any exceptions or user errors are converted to warnings so that
 the template enhancement buffer is not prevented from being flushed.

 Developed in https://github.com/WordPress/wordpress-develop/pull/10310

 Follow-up to [61111], [61088], [60936].

 Props westonruter, dmsnell.
 See #43258, #64126.
 Fixes #64108.
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/43258#comment:88>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list