-
Couldn't load subscription status.
- Fork 135
Open
Open
Copy link
Labels
[Plugin] Optimization DetectiveIssues for the Optimization Detective pluginIssues for the Optimization Detective plugin[Type] EnhancementA suggestion for improvement of an existing featureA suggestion for improvement of an existing feature
Description
Instead of Optimization Detective hackily opening its own output buffer via od_buffer_output() during the template_include filter:
| add_filter( 'template_include', 'od_buffer_output', PHP_INT_MAX ); |
In WordPress 6.9 we can now leverage the template enhancement output buffer introduced via Core-43258 (see r60936). When the wp_start_template_enhancement_output_buffer() function exists, we can skip starting our own output buffer:
if ( ! function_exists( 'wp_start_template_enhancement_output_buffer' ) ) {
add_filter( 'template_include', 'od_buffer_output', PHP_INT_MAX );
}And then od_template_output_buffer() can be updated accordingly:
if ( function_exists( 'wp_start_template_enhancement_output_buffer' ) ) {
add_filter( 'wp_template_enhancement_output_buffer', $callback );
} else {
add_filter( 'od_template_output_buffer', $callback );
}adamsilverstein
Metadata
Metadata
Assignees
Labels
[Plugin] Optimization DetectiveIssues for the Optimization Detective pluginIssues for the Optimization Detective plugin[Type] EnhancementA suggestion for improvement of an existing featureA suggestion for improvement of an existing feature
Type
Projects
Status
Not Started/Backlog 📆