diff --git a/wp-includes/class.wp-dependencies.php b/wp-includes/class.wp-dependencies.php index 11068f970a..5a1a9286e7 100644 --- a/wp-includes/class.wp-dependencies.php +++ b/wp-includes/class.wp-dependencies.php @@ -77,6 +77,7 @@ class WP_Dependencies { * * @access public * @since 2.8.0 + * @deprecated 4.5.0 * @var int */ public $group = 0; @@ -161,7 +162,8 @@ class WP_Dependencies { if ( in_array($handle, $this->done, true) ) // Already done continue; - $moved = $this->set_group( $handle, $recursion, $group ); + $moved = $this->set_group( $handle, $recursion, $group ); + $new_group = $this->groups[ $handle ]; if ( $queued && !$moved ) // already queued and in the right group continue; @@ -171,7 +173,7 @@ class WP_Dependencies { $keep_going = false; // Item doesn't exist. elseif ( $this->registered[$handle]->deps && array_diff($this->registered[$handle]->deps, array_keys($this->registered)) ) $keep_going = false; // Item requires dependencies that don't exist. - elseif ( $this->registered[$handle]->deps && !$this->all_deps( $this->registered[$handle]->deps, true, $group ) ) + elseif ( $this->registered[$handle]->deps && !$this->all_deps( $this->registered[$handle]->deps, true, $new_group ) ) $keep_going = false; // Item requires dependencies that don't exist. if ( ! $keep_going ) { // Either item or its dependencies don't exist. @@ -397,16 +399,12 @@ class WP_Dependencies { public function set_group( $handle, $recursion, $group ) { $group = (int) $group; - if ( $recursion ) { - $group = min( $this->group, $group ); + if ( isset( $this->groups[ $handle ] ) && $this->groups[ $handle ] <= $group ) { + return false; } - $this->group = $group; + $this->groups[ $handle ] = $group; - if ( isset($this->groups[$handle]) && $this->groups[$handle] <= $group ) - return false; - - $this->groups[$handle] = $group; return true; } diff --git a/wp-includes/class.wp-scripts.php b/wp-includes/class.wp-scripts.php index 0b3f922ed0..655c07f23d 100644 --- a/wp-includes/class.wp-scripts.php +++ b/wp-includes/class.wp-scripts.php @@ -509,7 +509,7 @@ class WP_Scripts extends WP_Dependencies { * @return bool True on success, false on failure. */ public function all_deps( $handles, $recursion = false, $group = false ) { - $r = parent::all_deps( $handles, $recursion ); + $r = parent::all_deps( $handles, $recursion, $group ); if ( ! $recursion ) { /** * Filter the list of script dependencies left to print. diff --git a/wp-includes/class.wp-styles.php b/wp-includes/class.wp-styles.php index 788e8a3fa9..a175058baa 100644 --- a/wp-includes/class.wp-styles.php +++ b/wp-includes/class.wp-styles.php @@ -310,7 +310,7 @@ class WP_Styles extends WP_Dependencies { * @return bool True on success, false on failure. */ public function all_deps( $handles, $recursion = false, $group = false ) { - $r = parent::all_deps( $handles, $recursion ); + $r = parent::all_deps( $handles, $recursion, $group ); if ( ! $recursion ) { /** * Filter the array of enqueued styles before processing for output. diff --git a/wp-includes/version.php b/wp-includes/version.php index 08a2b015b5..8abd2d8477 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.5-beta2-36870'; +$wp_version = '4.5-beta2-36871'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.