Opened 8 years ago
Closed 6 years ago
#41575 closed enhancement (fixed)
Add global action to get_template_part
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 5.2 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Themes | Keywords: | has-patch |
Focuses: | template | Cc: |
Description
I would like to see
do_action( "get_template_part", $slug, $name );
in get_template_part. Right now there is no means to track or do any action on every template call. A feature I want to implement in a plugin relies on this to function how I want. As of now I can only get the primary template.
Attachments (1)
Change History (12)
#2
@
8 years ago
That is very similar to what is there now:
do_action( "get_template_part_{$slug}", $slug, $name );
but I can see that it would be difficult to do a generic action since the slug is part of the action name.
Reviewing themes, I have seen quite a variety of slugs used, mostly with a folder structure. This really does not lend itself to reuse.
#3
@
7 years ago
- Keywords needs-patch good-first-bug added
I think it's time that this happened. It can really help with debugging and analysis.
#5
@
7 years ago
- Keywords good-first-bug removed
- Milestone changed from Awaiting Review to 5.0
- Owner set to johnbillion
- Status changed from new to reviewing
Note: See
TracTickets for help on using
tickets.
Related: #13239, #40258, #40508.