Make WordPress Core

Opened 10 years ago

Closed 10 years ago

#31273 closed enhancement (duplicate)

Register JavaScript templates with wp_enqueue_script()

Reported by: danielbachhuber's profile 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)

#1 @rmccue
10 years ago

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 the script_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).

#2 @Funkatronic
10 years ago

Ticket #31281 is a possible duplicate (with a solution)

#3 @danielbachhuber
10 years ago

  • Milestone Future Release deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #31281.

Note: See TracTickets for help on using tickets.