Skip to content

Commit 1b52681

Browse files
committed
Block: Correctly load viewStyle in the head tag when wp_should_load_block_assets_on_demand is false
1 parent 3d9fde3 commit 1b52681

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
@@ -2750,6 +2750,11 @@ function wp_enqueue_registered_block_scripts_and_styles() {
27502750
foreach ( $block_type->editor_script_handles as $editor_script_handle ) {
27512751
wp_enqueue_script( $editor_script_handle );
27522752
}
2753+
} elseif ( ! is_admin() ) {
2754+
// Front-end styles.
2755+
foreach ( $block_type->view_style_handles as $view_style_handle ) {
2756+
wp_enqueue_style( $view_style_handle );
2757+
}
27532758
}
27542759
}
27552760
}

0 commit comments

Comments
 (0)