Skip to content

Commit 64d63da

Browse files
committed
Add od_start_template_optimization action
1 parent abdefc0 commit 64d63da

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

plugins/optimization-detective/optimization.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,18 @@ static function () use ( $reasons ): void {
139139
od_get_url_metric_freshness_ttl()
140140
);
141141

142+
/**
143+
* Fires when the current OD_URL_Metric_Group_Collection has been constructed for the response.
144+
*
145+
* @since n.e.x.t
146+
* @todo The parameters should be put into a context object as is done with other such actions.
147+
*
148+
* @param OD_URL_Metric_Group_Collection $group_collection URL Metric group collection.
149+
* @param OD_Tag_Visitor_Registry $tag_visitor_registry Tag visitor registry.
150+
* @param WP_Post|null $post The od_url_metrics post if it exists.
151+
*/
152+
do_action( 'od_start_template_optimization', $group_collection, $tag_visitor_registry, $post );
153+
142154
$callback = static function ( string $buffer ) use ( $tag_visitor_registry, $group_collection, $slug, $post_id ): string {
143155
return od_optimize_template_output_buffer(
144156
$buffer,

0 commit comments

Comments
 (0)