Opened 10 years ago
Closed 10 years ago
#31273 closed enhancement (duplicate)
Register JavaScript templates with wp_enqueue_script()
Reported by: | danielbachhuber | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Script Loader | Keywords: | needs-patch |
Focuses: | Cc: |
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.
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_tag
filter 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).