Skip to content

Commit e360e72

Browse files
committed
Block: Correctly load viewStyle in the head tag when wp_should_load_block_assets_on_demand is false
1 parent 35ca22a commit e360e72

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/wp-includes/script-loader.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2711,6 +2711,11 @@ function wp_enqueue_registered_block_scripts_and_styles() {
27112711
foreach ( $block_type->editor_script_handles as $editor_script_handle ) {
27122712
wp_enqueue_script( $editor_script_handle );
27132713
}
2714+
} elseif ( ! is_admin() ) {
2715+
// Front-end styles.
2716+
foreach ( $block_type->view_style_handles as $view_style_handle ) {
2717+
wp_enqueue_style( $view_style_handle );
2718+
}
27142719
}
27152720
}
27162721
}

0 commit comments

Comments
 (0)