[wp-trac] [WordPress Trac] #25247: WP_Dependencies unsets a to do item when it isn't loaded
WordPress Trac
noreply at wordpress.org
Fri Sep 6 23:51:59 UTC 2013
#25247: WP_Dependencies unsets a to do item when it isn't loaded
--------------------------+-----------------------------
Reporter: markoheijnen | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version:
Severity: normal | Keywords:
--------------------------+-----------------------------
Currently it unsets $this->to_do no matter if do_item() return true or
false. For example If you move jquery to the footer it will not load
jquery at all. since it thinks jquery-core is loaded.
{{{
add_action( 'wp_default_scripts',
'move_jquery_to_footer_and_not_load_migrate' );
public function move_jquery_to_footer_and_not_load_migrate( &$scripts ) {
if( ! is_admin() ) {
$scripts->registered['jquery']->deps = array( 'jquery-
core' );
$scripts->add_data( 'jquery', 'group', 1 );
$scripts->add_data( 'jquery-core', 'group', 1 );
}
}
}}}
--
Ticket URL: <http://core.trac.wordpress.org/ticket/25247>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list