File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -280,7 +280,7 @@ public function print_import_map() {
280
280
*/
281
281
private function get_import_map (): array {
282
282
global $ wp_scripts ;
283
- $ script_module_ids = array ();
283
+ $ classic_script_module_dependencies = array ();
284
284
if ( $ wp_scripts instanceof WP_Scripts ) {
285
285
foreach ( $ wp_scripts ->registered as $ dependency ) {
286
286
$ handle = $ dependency ->handle ;
@@ -294,25 +294,22 @@ private function get_import_map(): array {
294
294
}
295
295
296
296
$ module_deps = $ wp_scripts ->get_data ( $ handle , 'module_deps ' );
297
- if ( ! is_array ( $ module_deps ) ) {
297
+ if ( ! $ module_deps ) {
298
298
continue ;
299
299
}
300
-
301
- foreach ( $ module_deps as $ id ) {
302
- $ script_module_ids [] = $ id ;
303
- }
300
+ array_push ( $ classic_script_module_dependencies , ...$ module_deps );
304
301
}
305
302
}
306
303
307
304
$ imports = array ();
308
- foreach ( $ this ->get_dependencies ( array_merge ( $ script_module_ids , array_keys ( $ this ->get_marked_for_enqueue () ) ) ) as $ id => $ script_module ) {
305
+ foreach ( $ this ->get_dependencies ( array_merge ( $ classic_script_module_dependencies , array_keys ( $ this ->get_marked_for_enqueue () ) ) ) as $ id => $ script_module ) {
309
306
$ src = $ this ->get_src ( $ id );
310
307
if ( null === $ src ) {
311
308
continue ;
312
309
}
313
310
$ imports [ $ id ] = $ src ;
314
311
}
315
- foreach ( $ script_module_ids as $ id ) {
312
+ foreach ( $ classic_script_module_dependencies as $ id ) {
316
313
$ src = $ this ->get_src ( $ id );
317
314
if ( null === $ src ) {
318
315
continue ;
You can’t perform that action at this time.
0 commit comments