Opened 9 years ago
Closed 7 years ago
#41575 closed enhancement (fixed)
Add global action to get_template_part
| Reported by: | pcfreak30 | Owned by: | johnbillion |
|---|---|---|---|
| Priority: | normal | Milestone: | 5.2 |
| Component: | Themes | Version: | |
| Severity: | normal | Keywords: | has-patch |
| Cc: | Focuses: | template |
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
@
9 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
@
8 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
@
8 years ago
- Keywords good-first-bug removed
- Milestone Awaiting Review → 5.0
- Owner set to
- Status new → reviewing
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Related: #13239, #40258, #40508.