Queue all default scripts for the head when a custom script lists them as dependencies, fixes #9620
git-svn-id: https://develop.svn.wordpress.org/trunk@11058 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
563583c87b
commit
bb93b6bab4
@ -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 );
|
||||
$moved = $this->set_group( $handle, $recursion, $group );
|
||||
|
||||
if ( in_array($handle, $this->to_do, true) ) // Already grobbed it and its deps
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -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 ) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user