Opened 12 years ago
Closed 12 years ago
#31273 closed enhancement (duplicate)
Register JavaScript templates with wp_enqueue_script()
| Reported by: | danielbachhuber | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Script Loader | Version: | |
| Severity: | normal | Keywords: | needs-patch |
| Cc: | Focuses: |
Description
This would make it much easier to conditionally include templates, instead of including them everywhere all the time.
Change History (3)
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
This could almost be done via
WP_Scripts::add_data, however there's no way to set the type or ID on that. (You could build a plugin solution via thescript_loader_tagfilter too.)+1 on extending the data system to support that, +0 on adding support for templates specifically (not sure we need the full complexity there).