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.
Built from https://develop.svn.wordpress.org/trunk@51256


git-svn-id: http://core.svn.wordpress.org/trunk@50865 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2021-06-29 11:12:02 +00:00
parent 186d7c75ea
commit 600d611e0d
2 changed files with 15 additions and 1 deletions

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.

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.8-beta4-51255';
$wp_version = '5.8-beta4-51256';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.