[wp-trac] [WordPress Trac] #25247: WP_Dependencies unsets a to do item when it isn't loaded
WordPress Trac
noreply at wordpress.org
Sat Feb 20 15:44:27 UTC 2016
#25247: WP_Dependencies unsets a to do item when it isn't loaded
-------------------------------------------------+-------------------------
Reporter: markoheijnen | Owner: chriscct7
Type: defect (bug) | Status: reviewing
Priority: normal | Milestone: Future
Component: Script Loader | Release
Severity: normal | Version: 3.6
Keywords: has-patch dev-feedback needs- | Resolution:
testing has-unit-tests | Focuses:
-------------------------------------------------+-------------------------
Comment (by ocean90):
Replying to [comment:3 ocean90]:
> This script has worked until 3.6:
>
> {{{
> /**
> * Prints jQuery in footer on front-end.
> */
> function ds_print_jquery_in_footer( &$scripts) {
> if ( ! is_admin() )
> $scripts->add_data( 'jquery', 'group', 1 );
> }
> add_action( 'wp_default_scripts', 'ds_print_jquery_in_footer' );
> }}}
>
>
> With 3.6 I would set the group arg for the dependencies to 1 too, but
that doesn't work.
After [36550] this is working now:
{{{#!php
<?php
/**
* Prints jQuery in footer on front-end.
*/
function ds_print_jquery_in_footer( &$scripts) {
if ( ! is_admin() ) {
$scripts->add_data( 'jquery-core', 'group', 1 );
$scripts->add_data( 'jquery', 'group', 1 );
$scripts->add_data( 'jquery-migrate', 'group', 1 );
}
}
add_action( 'wp_default_scripts', 'ds_print_jquery_in_footer' );
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/25247#comment:25>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list