Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #54541, comment 9


Ignore:
Timestamp:
09/20/2022 05:47:30 PM (2 years ago)
Author:
johnjamesjacoby
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #54541, comment 9

    initial v1  
    55Is it possible that `load_template()` is where these exact hooks belong (with the `$template_names` param removed)? Obviously, that is the function responsible for requiring the located file with the intended variables available to it, and the measurable code execution for Query Monitor is the extraction of the `query_vars` and the rendering/inclusion of the template file.
    66
    7 In addition, `load_template()` is used by many of the most popular WordPress plugins – not `locate_template()` – which means their template parts will never see these hooks fire and unable to benefit from any imaginary fragment caching implementation that may-or-may-not come in the future because of these hooks.
     7In my research & experience, `load_template()` is used by many of the most popular WordPress plugins – not `locate_template()` – which means their template parts will never see these hooks fire and be unable to benefit from any future fragment caching implementation that may want to use them.
    88
    99=== Scopecreep
     
    1313== Plugins
    1414
    15 Mostly, these plugins use `load_template()` to get around the fact that `locate_template()` is strictly locked down to the parent/child theme hierarchy, and they write their own "locators" with extra locations to add to the core hierarchy under certain controlled conditions.
     15Mostly, the plugins below use `load_template()` to get around the fact that `locate_template()` is strictly locked down to the parent/child theme hierarchy, so they write their own "locators" with extra paths to add to the core hierarchy under certain controlled conditions.
    1616
    1717* bbPress & BuddyPress for theme compatibility
     
    2828
    2929Asking respectfully for your friendly additional thoughts & feedbacks 💫🤝
     30
     31(Edit: reworded some stuff for improved tone 💟)