[wp-trac] [WordPress Trac] #64108: Triggered errors are not displayed when applying template enhancement output buffer filters

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


#64108: Triggered errors are not displayed when applying template enhancement
output buffer filters
--------------------------------------+--------------------------
 Reporter:  westonruter               |       Owner:  westonruter
     Type:  defect (bug)              |      Status:  closed
 Priority:  normal                    |   Milestone:  6.9
Component:  General                   |     Version:  trunk
 Severity:  normal                    |  Resolution:  fixed
 Keywords:  has-patch has-unit-tests  |     Focuses:  performance
--------------------------------------+--------------------------
Changes (by westonruter):

 * status:  assigned => closed
 * resolution:   => fixed


Comment:

 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/64108#comment:10>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list