[wp-trac] [WordPress Trac] #35957: wp_register_script loads all dependencies in head even if some dependencies are specified to load in footer.
WordPress Trac
noreply at wordpress.org
Thu Feb 25 23:45:47 UTC 2016
#35957: wp_register_script loads all dependencies in head even if some dependencies
are specified to load in footer.
---------------------------+-----------------------------
Reporter: pderksen | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Script Loader | Version: trunk
Severity: normal | Keywords:
Focuses: javascript |
---------------------------+-----------------------------
In the following example, `child-footer` should render in the footer right
before `parent`, but instead is rendered in the head right after 'child-
head'.
{{{#!php
function my_enqueue_scripts() {
wp_register_script( 'child-head', '/child-head.js', array(), null,
false );
wp_register_script( 'child-footer', '/child-footer.js', array(),
null, true );
wp_register_script( 'parent', '/parent.js', array( 'child-head',
'child-footer' ), null, true );
wp_enqueue_script( 'parent' );
}
add_action( 'wp_enqueue_scripts', 'my_enqueue_scripts' );
}}}
Possibly related: #35873
--
Ticket URL: <https://core.trac.wordpress.org/ticket/35957>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list