Changeset 54155 for trunk/src/wp-includes/script-loader.php
- Timestamp:
- 09/14/2022 10:50:26 AM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/script-loader.php
r54118 r54155 2532 2532 } 2533 2533 2534 $load_editor_scripts = is_admin() && wp_should_load_block_editor_scripts_and_styles();2534 $load_editor_scripts_and_styles = is_admin() && wp_should_load_block_editor_scripts_and_styles(); 2535 2535 2536 2536 $block_registry = WP_Block_Type_Registry::get_instance(); 2537 2537 foreach ( $block_registry->get_all_registered() as $block_name => $block_type ) { 2538 // Front-end styles. 2539 if ( ! empty( $block_type->style ) ) { 2540 wp_enqueue_style( $block_type->style ); 2541 } 2542 2543 // Front-end script. 2544 if ( ! empty( $block_type->script ) ) { 2545 wp_enqueue_script( $block_type->script ); 2546 } 2547 2548 // Editor styles. 2549 if ( $load_editor_scripts && ! empty( $block_type->editor_style ) ) { 2550 wp_enqueue_style( $block_type->editor_style ); 2551 } 2552 2553 // Editor script. 2554 if ( $load_editor_scripts && ! empty( $block_type->editor_script ) ) { 2555 wp_enqueue_script( $block_type->editor_script ); 2538 // Front-end and editor styles. 2539 foreach ( $block_type->style_handles as $style_handle ) { 2540 wp_enqueue_style( $style_handle ); 2541 } 2542 2543 // Front-end and editor scripts. 2544 foreach ( $block_type->script_handles as $script_handle ) { 2545 wp_enqueue_script( $script_handle ); 2546 } 2547 2548 if ( $load_editor_scripts_and_styles ) { 2549 // Editor styles. 2550 foreach ( $block_type->editor_style_handles as $editor_style_handle ) { 2551 wp_enqueue_style( $editor_style_handle ); 2552 } 2553 2554 // Editor scripts. 2555 foreach ( $block_type->editor_script_handles as $editor_script_handle ) { 2556 wp_enqueue_script( $editor_script_handle ); 2557 } 2556 2558 } 2557 2559 }
Note: See TracChangeset
for help on using the changeset viewer.