Docs: Improve documentation for wp_should_load_separate_core_block_assets().

This should clarify the purpose of the function and what effect it has on block styles loading.

Props aristath, desrosj, jorbin, SergeyBiryukov.
See #53505.

git-svn-id: https://develop.svn.wordpress.org/trunk@51256 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2021-06-29 11:10:33 +00:00
parent 81e1c2d58b
commit a4a84bc730

View File

@ -2328,6 +2328,20 @@ function wp_should_load_block_editor_scripts_and_styles() {
/**
* Checks whether separate assets should be loaded for core blocks on-render.
*
* When this function returns true, other functions ensure that core blocks
* only load their styles on-render, and each block loads its own, individual
* stylesheet. Third-party blocks only load their styles when rendered.
*
* When this function returns false, all core block styles are loaded regardless
* of whether they are rendered in a page or not, because they are all part of
* the `block-library/style.css` file. Third-party blocks always get enqueued
* regardless of whether they are rendered or not.
*
* This only affects front end and not the block editor screens.
*
* @see wp_enqueue_registered_block_scripts_and_styles()
* @see register_block_style_handle()
*
* @since 5.8.0
*
* @return bool Whether separate assets will be loaded.