[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:07:17 UTC 2015


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

 * owner:   => wonderboymusic
 * status:  new => closed
 * resolution:   => fixed


Comment:

 In [changeset:"31032"]:
 {{{
 #!CommitTicketReference repository="" revision="31032"
 Add the ability to print data *after* a script, whether it is concatenated
 or not:

 * Add a third argument to `WP_Scripts->print_extra_script()`, `$key`,
 which will be passed to `->get_data()` (no longer passes hardcoded
 `'data'`)
 * When `$key` is set to `'data-after'`, the inline script will be printed
 after the `<script>` tag. If the scripts are being concatenated, all
 scripts' `'data-after'` data will be printed after the concatenated
 `<script>` has been rendered.

 Props hakre, wonderboymusic.
 Fixes #25277.
 }}}

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


More information about the wp-trac mailing list