From aed15fedb9f0f74a4fa913db60d06149e78e382b Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Mon, 5 Feb 2024 09:43:12 +0000 Subject: [PATCH] Script Loader: Remove unused `WP_Scripts::get_unaliased_deps()` method. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This private method was introduced in [56033] / #12009 but it's not actually used. It was part of the inline script implementation which was later reverted before final merge. The method can be safely removed because it’s private and cannot be used by extenders. Props joemcgill. Fixes #60438. Built from https://develop.svn.wordpress.org/trunk@57533 git-svn-id: http://core.svn.wordpress.org/trunk@57034 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-wp-scripts.php | 27 --------------------------- wp-includes/version.php | 2 +- 2 files changed, 1 insertion(+), 28 deletions(-) diff --git a/wp-includes/class-wp-scripts.php b/wp-includes/class-wp-scripts.php index 116e98f673..7e4bd2732a 100644 --- a/wp-includes/class-wp-scripts.php +++ b/wp-includes/class-wp-scripts.php @@ -524,33 +524,6 @@ class WP_Scripts extends WP_Dependencies { return trim( implode( "\n", $data ), "\n" ); } - /** - * Gets unaliased dependencies. - * - * An alias is a dependency whose src is false. It is used as a way to bundle multiple dependencies in a single - * handle. This in effect flattens an alias dependency tree. - * - * @since 6.3.0 - * - * @param string[] $deps Dependency handles. - * @return string[] Unaliased handles. - */ - private function get_unaliased_deps( array $deps ) { - $flattened = array(); - foreach ( $deps as $dep ) { - if ( ! isset( $this->registered[ $dep ] ) ) { - continue; - } - - if ( $this->registered[ $dep ]->src ) { - $flattened[] = $dep; - } elseif ( $this->registered[ $dep ]->deps ) { - array_push( $flattened, ...$this->get_unaliased_deps( $this->registered[ $dep ]->deps ) ); - } - } - return $flattened; - } - /** * Gets tags for inline scripts registered for a specific handle. * diff --git a/wp-includes/version.php b/wp-includes/version.php index 72c0faa349..15d1fcb3c1 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.5-alpha-57532'; +$wp_version = '6.5-alpha-57533'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.