[wp-trac] [WordPress Trac] #23816: wp_enqueue_script|style() dependency failures are silent

WordPress Trac noreply at wordpress.org
Wed Nov 19 04:42:44 UTC 2014


#23816: wp_enqueue_script|style() dependency failures are silent
------------------------------------+------------------------------
 Reporter:  johnbillion             |       Owner:
     Type:  enhancement             |      Status:  reopened
 Priority:  normal                  |   Milestone:  Awaiting Review
Component:  Script Loader           |     Version:
 Severity:  normal                  |  Resolution:
 Keywords:  needs-docs needs-patch  |     Focuses:
------------------------------------+------------------------------
Changes (by rmccue):

 * keywords:  has-patch needs-docs => needs-docs needs-patch


Comment:

 Ran into an issue with this one. Dependency resolution takes place for all
 scripts in the header, and again in the footer. If you register a script
 to output in the footer, but it depends on something registered after
 `wp_head`, you get an error despite the script being output correctly.

 We need to take this into account when passing in `$handles` to
 `all_deps`; an `array_filter` should suffice.

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


More information about the wp-trac mailing list