[wp-trac] [WordPress Trac] #31281: Register JavaScript/Underscore templates using the WP Dependency API

WordPress Trac noreply at wordpress.org
Mon Jul 6 12:22:42 UTC 2015


#31281: Register JavaScript/Underscore templates using the WP Dependency API
---------------------------+------------------------------
 Reporter:  F J Kaiser     |       Owner:
     Type:  enhancement    |      Status:  new
 Priority:  normal         |   Milestone:  Awaiting Review
Component:  Script Loader  |     Version:
 Severity:  normal         |  Resolution:
 Keywords:                 |     Focuses:
---------------------------+------------------------------

Comment (by ninjamonk):

 I would vote for a simpler implementation which would just require a new
 function for called wp_enqueue_template_script which is a straight up copy
 of wp_enqueue_script but with the last parameter containing the type for
 the script.


 {{{

 $type = "text/x-handlebars-template";
 wp_enqueue_template_script( $handle, $src, $deps, $ver, $in_footer, $type
 );

 }}}

 this way you could use any javascript template system that uses a custom
 script type like handlebars.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/31281#comment:11>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list