Skip to content

Commit d30c9de

Browse files
committed
Fix overwriting array keys
The + operator merges arrays with key overwriting. array_merge renumbers numeric arrays, the desired behavior in this case.
1 parent 751887b commit d30c9de

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ public function print_import_map() {
305305
*/
306306
private function get_import_map(): array {
307307
$imports = array();
308-
$script_module_ids = $this->marked_for_inclusion + array_keys( $this->get_marked_for_enqueue() );
308+
$script_module_ids = array_merge( $this->marked_for_inclusion, array_keys( $this->get_marked_for_enqueue() ) );
309309

310310
foreach ( $this->get_dependencies( $script_module_ids ) as $id => $script_module ) {
311311
$src = $this->get_src( $id );

0 commit comments

Comments
 (0)