File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -617,7 +617,8 @@ public function render( $options = array() ) {
617
617
}
618
618
}
619
619
620
- if ( ( ! empty ( $ this ->block_type ->view_style_handles ) ) ) {
620
+ // Only enqueue if not already enqueued by wp_enqueue_registered_block_scripts_and_styles.
621
+ if ( ( ! empty ( $ this ->block_type ->view_style_handles ) ) && wp_should_load_block_assets_on_demand () ) {
621
622
foreach ( $ this ->block_type ->view_style_handles as $ view_style_handle ) {
622
623
wp_enqueue_style ( $ view_style_handle );
623
624
}
Original file line number Diff line number Diff line change @@ -2696,6 +2696,11 @@ function wp_enqueue_registered_block_scripts_and_styles() {
2696
2696
wp_enqueue_style ( $ style_handle );
2697
2697
}
2698
2698
2699
+ // Front-end styles.
2700
+ foreach ( $ block_type ->view_style_handles as $ view_style_handle ) {
2701
+ wp_enqueue_style ( $ view_style_handle );
2702
+ }
2703
+
2699
2704
// Front-end and editor scripts.
2700
2705
foreach ( $ block_type ->script_handles as $ script_handle ) {
2701
2706
wp_enqueue_script ( $ script_handle );
You can’t perform that action at this time.
0 commit comments