[wp-trac] [WordPress Trac] #25277: WP_scripts does not allow to add data after the enque has been added to HTML

WordPress Trac noreply at wordpress.org
Sat Jan 3 05:06:27 UTC 2015


#25277: WP_scripts does not allow to add data after the enque has been added to
HTML
-----------------------------+------------------
 Reporter:  hakre            |       Owner:
     Type:  feature request  |      Status:  new
 Priority:  normal           |   Milestone:  4.2
Component:  Script Loader    |     Version:  3.6
 Severity:  normal           |  Resolution:
 Keywords:  has-patch        |     Focuses:
-----------------------------+------------------
Changes (by wonderboymusic):

 * milestone:  Awaiting Review => 4.2


Comment:

 This is a good idea:

 {{{
 $scripts->add_data( 'utils', 'data', 'var cool = ' . json_encode( array(
 'stuff' => 1 ) ) . ";" );
 $scripts->add_data( 'utils', 'data-after', 'new Boom();' );
 }}}

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


More information about the wp-trac mailing list