mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-01 15:50:09 +00:00
Build/Test: Fix incorrect hook being used to separate Server-Timing metrics in performance tests.
The `wp-before-template` and `wp-template` metric intend to separate WordPress core's own bootstrap process from any logic that is part of the eventual template loaded. The appropriate hook for that is the `template_include` filter as that occurs right before the template file is included. Props mukesh27, joemcgill. Fixes #58674. git-svn-id: https://develop.svn.wordpress.org/trunk@56162 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
|
||||
add_action(
|
||||
'template_redirect',
|
||||
static function() {
|
||||
add_filter(
|
||||
'template_include',
|
||||
static function( $template ) {
|
||||
|
||||
global $timestart;
|
||||
|
||||
@@ -38,6 +38,8 @@ add_action(
|
||||
},
|
||||
PHP_INT_MIN
|
||||
);
|
||||
|
||||
return $template;
|
||||
},
|
||||
PHP_INT_MAX
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user