Skip to content

Commit

Permalink
Fix overwriting array keys
Browse files Browse the repository at this point in the history
The + operator merges arrays with key overwriting.
array_merge renumbers numeric arrays, the desired behavior in this case.
  • Loading branch information
sirreal committed Dec 17, 2024
1 parent 16de852 commit 350705f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/wp-includes/class-wp-script-modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ public function print_import_map() {
*/
private function get_import_map(): array {
$imports = array();
$script_module_ids = $this->marked_for_inclusion + array_keys( $this->get_marked_for_enqueue() );
$script_module_ids = array_merge( $this->marked_for_inclusion, array_keys( $this->get_marked_for_enqueue() ) );

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

0 comments on commit 350705f

Please sign in to comment.