Make WordPress Core

Changeset 56162


Ignore:
Timestamp:
07/07/2023 05:39:09 PM (20 months ago)
Author:
flixos90
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/performance/wp-content/mu-plugins/server-timing.php

    r55822 r56162  
    11<?php
    22
    3 add_action(
    4     'template_redirect',
    5     static function() {
     3add_filter(
     4    'template_include',
     5    static function( $template ) {
    66
    77        global $timestart;
     
    3939            PHP_INT_MIN
    4040        );
     41
     42        return $template;
    4143    },
    4244    PHP_INT_MAX
Note: See TracChangeset for help on using the changeset viewer.