From 600d611e0dbf6af18f2388ac17645349364927ba Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Tue, 29 Jun 2021 11:12:02 +0000 Subject: [PATCH] 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 --- wp-includes/script-loader.php | 14 ++++++++++++++ wp-includes/version.php | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php index 3227204501..fa06871b7b 100644 --- a/wp-includes/script-loader.php +++ b/wp-includes/script-loader.php @@ -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. diff --git a/wp-includes/version.php b/wp-includes/version.php index 252cf69779..4a0a89254b 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -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.