should_load_separate_core_block_assets filter-hookWP 5.8.0

Filters whether block styles should be loaded separately.

Returning false loads all core block assets, regardless of whether they are rendered in a page or not. Returning true loads core block assets only when they are rendered.


add_filter( 'should_load_separate_core_block_assets', 'wp_kama_should_load_separate_core_block_assets_filter' );

 * Function for `should_load_separate_core_block_assets` filter-hook.
 * @param bool $load_separate_assets Whether separate assets will be loaded.
 * @return bool
function wp_kama_should_load_separate_core_block_assets_filter( $load_separate_assets ){

	// filter...
	return $load_separate_assets;
Whether separate assets will be loaded.
Default: false (all block assets are loaded, even when not used)


Since 5.8.0 Introduced.

Where the hook is called

wp-includes/script-loader.php 2605
return apply_filters( 'should_load_separate_core_block_assets', false );

Where the hook is used in WordPress

wp-includes/theme.php 4364
add_filter( 'should_load_separate_core_block_assets', '__return_true' );