Filters whether block styles should be loaded on demand.
Description
Returning false loads all block assets, regardless of whether they are rendered in a page or not.Returning true loads block assets only when they are rendered. The default value of the filter depends on the result of wp_should_load_separate_core_block_assets(), which controls whether Core block stylesheets should be loaded separately or via a combined 'wp-block-library' stylesheet.
Parameters
$load_assets_on_demandbool
Whether to load block assets only when they are rendered.
2747* stylesheet.2748*2749* @since 6.8.02750*2751* @param bool$load_assets_on_demand Whether to load block assets only when they are rendered.2752*/2753returnapply_filters('should_load_block_assets_on_demand',$load_assets_on_demand);2754}27552756/**2757* Enqueues registered block scripts and styles, depending on current rendered2758*context(only enqueuing editor scripts while in context of the editor).2759*
History
Introduced in 6.8.0. Unchanged from 6.8.8 through 7.1.0.