Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/wp-includes/script-loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -2772,6 +2772,11 @@ function wp_enqueue_registered_block_scripts_and_styles() {
foreach ( $block_type->editor_script_handles as $editor_script_handle ) {
wp_enqueue_script( $editor_script_handle );
}
} elseif ( ! is_admin() ) {
// Front-end styles.
foreach ( $block_type->view_style_handles as $view_style_handle ) {
wp_enqueue_style( $view_style_handle );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So if block styles aren't loaded on demand, this will load every single style for every single registered block on the frontend? This had been the default experience for classic themes, and prior to 6.9, this could mean a lot more styles get enqueued. But with Core-64099, classic themes now enqueue block styles on demand by default. That is, unless you have opted out via a plugin like Load Combined Core Block Assets.

}
}
}
}
Expand Down
Loading