wpseek.com
WordPress开发者和主题制作者的搜索引擎



should_load_block_assets_on_demand › WordPress过滤钩子

Since6.8.0
已弃用n/a
› apply_filters( 'should_load_block_assets_on_demand', $load_assets_on_demand )
参数:
  • () load_assets_on_demand Whether to load block assets only when they are rendered.
    Required: Yes
定义在:
文档:

Filters whether block styles should be loaded on demand.

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 {@see \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.




源码

return apply_filters( 'should_load_block_assets_on_demand', $load_assets_on_demand );