@@ -999,14 +999,18 @@ static function ( int $level, string $message, ?string $file = null, ?int $line
999999 *
10001000 * This filter only applies the HTML output of an included template. This filter is a progressive enhancement
10011001 * intended for applications such as optimizing markup to improve frontend page load performance. Sites must not
1002- * depend on this filter applying since they may opt to stream the responses instead. Callbacks for this filter are
1003- * highly discouraged from using regular expressions to do any kind of replacement on the output. Use the HTML API
1004- * (either `WP_HTML_Tag_Processor` or `WP_HTML_Processor`), or else use {@see DOM\HtmlDocument} as of PHP 8.4 which
1005- * fully supports HTML5.
1002+ * depend on this filter applying since they may opt to stream the responses instead. Callbacks for this filter
1003+ * are highly discouraged from using regular expressions to do any kind of replacement on the output. Use the
1004+ * HTML API (either `WP_HTML_Tag_Processor` or `WP_HTML_Processor`), or else use {@see DOM\HtmlDocument} as of
1005+ * PHP 8.4 which fully supports HTML5.
10061006 *
1007- * Important: Because this filter is applied inside an output buffer callback (i.e. display handler), any callbacks
1008- * added to the filter must not attempt to start their own output buffers. Otherwise, PHP will raise a fatal error:
1009- * "Cannot use output buffering in output buffering display handlers."
1007+ * Do not print any output during this filter. While filters normally don't print anything, this is especially
1008+ * important since this applies during an output buffer callback. Prior to PHP 8.5, the output will be silently
1009+ * omitted, whereas afterward a deprecation notice will be emitted.
1010+ *
1011+ * Important: Because this filter is applied inside an output buffer callback (i.e. display handler), any
1012+ * callbacks added to the filter must not attempt to start their own output buffers. Otherwise, PHP will raise a
1013+ * fatal error: "Cannot use output buffering in output buffering display handlers."
10101014 *
10111015 * @since 6.9.0
10121016 *
@@ -1055,20 +1059,26 @@ static function ( int $level, string $message, ?string $file = null, ?int $line
10551059 /**
10561060 * Fires after the template enhancement output buffer has been finalized.
10571061 *
1058- * This happens immediately before the template enhancement output buffer is flushed. No output may be printed at
1059- * this action. However, HTTP headers may be sent, which makes this action complimentary to the
1062+ * This happens immediately before the template enhancement output buffer is flushed. No output may be printed
1063+ * at this action; prior to PHP 8.5, the output will be silently omitted, whereas afterward a deprecation notice
1064+ * will be emitted. Nevertheless, HTTP headers may be sent, which makes this action complimentary to the
10601065 * {@see 'send_headers'} action, in which headers may be sent before the template has started rendering. In
10611066 * contrast, this `wp_finalized_template_enhancement_output_buffer` action is the possible point at which HTTP
1062- * headers can be sent. This action does not fire if the "template enhancement output buffer" was not started. This
1063- * output buffer is automatically started if this action is added before
1064- * {@see wp_start_template_enhancement_output_buffer()} runs at the {@see 'wp_before_include_template'} action with
1065- * priority 1000. Before this point, the output buffer will also be started automatically if there was a
1067+ * headers can be sent. This action does not fire if the "template enhancement output buffer" was not started.
1068+ * This output buffer is automatically started if this action is added before
1069+ * {@see wp_start_template_enhancement_output_buffer()} runs at the {@see 'wp_before_include_template'} action
1070+ * with priority 1000. Before this point, the output buffer will also be started automatically if there was a
10661071 * {@see 'wp_template_enhancement_output_buffer'} filter added, or if the
10671072 * {@see 'wp_should_output_buffer_template_for_enhancement'} filter is made to return `true`.
10681073 *
1069- * Important: Because this action fires inside an output buffer callback (i.e. display handler), any callbacks added
1070- * to the action must not attempt to start their own output buffers. Otherwise, PHP will raise a fatal error:
1071- * "Cannot use output buffering in output buffering display handlers."
1074+ * Important: Because this action fires inside an output buffer callback (i.e. display handler), any callbacks
1075+ * added to the action must not attempt to start their own output buffers. Otherwise, PHP will raise a fatal
1076+ * error: "Cannot use output buffering in output buffering display handlers."
1077+ *
1078+ * If any errors are occur in callbacks for this action (e.g. deprecations, notices, warnings, exceptions),
1079+ * there will be no error message printed even if `display_errors` is enabled. This is because the output has
1080+ * already been finalized. The error will be emitted to the error log, however, as long as the error reporting
1081+ * level is configured.
10721082 *
10731083 * @since 6.9.0
10741084 *
0 commit comments