[wp-trac] [WordPress Trac] #35643: wp_enqueue_script() with an alias handle doesn't work in footer
WordPress Trac
noreply at wordpress.org
Thu Jan 28 12:53:11 UTC 2016
#35643: wp_enqueue_script() with an alias handle doesn't work in footer
---------------------------+-----------------------------
Reporter: kovshenin | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Script Loader | Version: trunk
Severity: normal | Keywords:
Focuses: |
---------------------------+-----------------------------
When registering an alias script (similar to how jquery is an alias for
jquery-core and jquery-migrate) in the footer, none of the declared
dependencies are processed.
This works:
{{{
add_action( 'wp_enqueue_scripts', function() {
wp_register_script( 'foo', false, array( 'bar', 'baz' ), '1.0' );
wp_register_script( 'bar', home_url( 'bar.js' ), array(), '1.0' );
wp_register_script( 'baz', home_url( 'baz.js' ), array(), '1.0' );
wp_enqueue_script( 'foo' );
});
}}}
This doesn't (no output):
{{{
add_action( 'wp_enqueue_scripts', function() {
wp_register_script( 'foo', false, array( 'bar', 'baz' ), '1.0',
true );
wp_register_script( 'bar', home_url( 'bar.js' ), array(), '1.0',
true );
wp_register_script( 'baz', home_url( 'baz.js' ), array(), '1.0',
true );
wp_enqueue_script( 'foo' );
});
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/35643>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list