Queue all default scripts for the head when a custom script lists them as dependencies, fixes #9620

git-svn-id: http://svn.automattic.com/wordpress/trunk@11058 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
azaozz 2009-04-22 21:01:36 +00:00
parent 6db7e7fbc5
commit d467c7522a
2 changed files with 11 additions and 7 deletions

View File

@ -83,18 +83,16 @@ class WP_Dependencies {
foreach ( $handles as $handle ) {
$handle_parts = explode('?', $handle);
$handle = $handle_parts[0];
$queued = in_array($handle, $this->to_do, true);
if ( in_array($handle, $this->done, true) ) // Already done
continue;
$this->set_group( $handle, $recursion, $group );
if ( in_array($handle, $this->to_do, true) ) // Already grobbed it and its deps
$moved = $this->set_group( $handle, $recursion, $group );
if ( $queued && !$moved ) // already queued and in the right group
continue;
if ( isset($handle_parts[1]) )
$this->args[$handle] = $handle_parts[1];
$keep_going = true;
if ( !isset($this->registered[$handle]) )
$keep_going = false; // Script doesn't exist
@ -110,6 +108,12 @@ class WP_Dependencies {
continue; // We're at the top level. Move on to the next one.
}
if ( $queued ) // Already grobbed it and its deps
continue;
if ( isset($handle_parts[1]) )
$this->args[$handle] = $handle_parts[1];
$this->to_do[] = $handle;
}

View File

@ -146,7 +146,7 @@ class WP_Scripts extends WP_Dependencies {
if ( false !== $group && $grp > $group )
$grp = $group;
parent::set_group( $handle, $recursion, $grp );
return parent::set_group( $handle, $recursion, $grp );
}
function all_deps( $handles, $recursion = false, $group = false ) {