Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: wp_template_enhancement_output_buffer

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
1010            * Important: Because this filter is applied inside an output buffer callback (i.e. display handler), any
1011            * callbacks added to the filter must not attempt to start their own output buffers. Otherwise, PHP will raise a
1012            * fatal error: "Cannot use output buffering in output buffering display handlers."
1013            *
1014            * @since 6.9.0
1015            *
1016            * @param string $filtered_output HTML template enhancement output buffer.
1017            * @param string $output          Original HTML template output buffer.
1018            */
1019           $filtered_output = (string) apply_filters( 'wp_template_enhancement_output_buffer', $filtered_output, $output );
1020      } catch ( Throwable $throwable ) {
1021           // Emit to the error log as a warning not as an error to prevent halting execution.
1022           $did_just_catch = true;
1023           trigger_error(
1024                sprintf(
1025                     /* translators: %s is the throwable class name */
1026                     __( 'Uncaught "%s" thrown:' ),
1027                     get_class( $throwable )
1028                ) . ' ' . $throwable->getMessage(),