[wp-trac] [WordPress Trac] #36392: wp_add_inline_script() breaks script dependency order when using script loader (no SCRIPT_DEBUG)

WordPress Trac noreply at wordpress.org
Fri Apr 1 04:43:28 UTC 2016


#36392: wp_add_inline_script() breaks script dependency order when using script
loader (no SCRIPT_DEBUG)
---------------------------+-------------------------
 Reporter:  westonruter    |      Owner:
     Type:  defect (bug)   |     Status:  new
 Priority:  normal         |  Milestone:  4.5
Component:  Script Loader  |    Version:  trunk
 Severity:  normal         |   Keywords:  needs-patch
  Focuses:                 |
---------------------------+-------------------------
 I've found that if an inline script is added via `wp_add_inline_script()`
 for a JS file registered in a plugin, if this script has a dependency on a
 core script that gets concatenated via `load-scripts.php`, the script
 dependency and the inline script will erroneously get printed ''before''
 the the script tag referencing `load-scripts.php` and the script it
 depends on.

 Here is a minimal test case:
 https://gist.github.com/westonruter/c8968edc125fd31ae2da4171ced8c62b

--
Ticket URL: <https://core.trac.wordpress.org/ticket/36392>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list