Skip to content

Commit c2f21ff

Browse files
Script Loader: Rename the script module dependencies variable in WP_Script_Modules::get_import_map().
Renames the variable that holds the script module dependencies of scripts to `$script_module_dependencies` and updates the comments to say "scripts", the name used in the rest of the codebase. There is no change in behavior. See #66591.
1 parent 3af54e5 commit c2f21ff

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

‎src/wp-includes/class-wp-script-modules.php‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,7 @@ public function print_import_map() {
648648
* Returns the import map array.
649649
*
650650
* @since 6.5.0
651-
* @since 7.0.0 Script module dependencies ('module_dependencies') of classic scripts are now included.
651+
* @since 7.0.0 Script module dependencies ('module_dependencies') of scripts are now included.
652652
*
653653
* @global WP_Scripts $wp_scripts
654654
*
@@ -660,8 +660,8 @@ private function get_import_map(): array {
660660

661661
$imports = array();
662662

663-
// Identify script modules that are dependencies of classic scripts.
664-
$classic_script_module_dependencies = array();
663+
// Identify script modules that are dependencies of scripts.
664+
$script_module_dependencies = array();
665665
if ( $wp_scripts instanceof WP_Scripts ) {
666666
$handles = array_merge(
667667
$wp_scripts->queue,
@@ -694,7 +694,7 @@ private function get_import_map(): array {
694694
if ( ! isset( $this->registered[ $id ] ) ) {
695695
$missing_module_dependencies[] = $id;
696696
} else {
697-
$classic_script_module_dependencies[] = $id;
697+
$script_module_dependencies[] = $id;
698698
}
699699
}
700700

@@ -728,8 +728,8 @@ private function get_import_map(): array {
728728
// Note: the script modules in $this->queue are not included in the importmap because they get printed as scripts.
729729
$ids = array_unique(
730730
array_merge(
731-
$classic_script_module_dependencies,
732-
array_keys( $this->get_dependencies( array_merge( $this->queue, $classic_script_module_dependencies ) ) )
731+
$script_module_dependencies,
732+
array_keys( $this->get_dependencies( array_merge( $this->queue, $script_module_dependencies ) ) )
733733
)
734734
);
735735
foreach ( $ids as $id ) {

0 commit comments

Comments
 (0)