-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add new actions before and after loading the located template #2462
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added a couple of minor notes inline, nothing to big.
I think @johnbillion wanted to review this too so maybe wait until you hear from John before taking any action. John's been around longer than me so may have additional advice.
@Tabrisrp , would you be able to apply the changes suggested by @peterwilsoncc? Then we could get @johnbillion to review and I would be more than happy to contribute with some unit tests. |
Co-authored-by: Peter Wilson <519727+peterwilsoncc@users.noreply.github.com>
@martinkrcho Done! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you. This code looks good to me.
I think John has limited availability at the moment, so let's give him a week or two to add any thougths to this ticket.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good but it would be good to pass some additional contextual parameters to the actions. I think the $template_names
, $require_once
, and $args
parameters are all potentially useful to these hooks, so let's pass them in please.
Committed in https://core.trac.wordpress.org/changeset/53560 |
This patch adds new actions before and after loading the located template in
locate_template()
.The template filename is passed as an additional parameter to the action, as that can be useful for callbacks on these hooks.
The hooks name and the
@since
value are suggestions, I couldn't find if there is a standard for hooks names in core, as there is some prefixed withwp_
, and others that are not.Trac ticket: https://core.trac.wordpress.org/ticket/54541
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.