From ad14ee34ebc6319cefb97a4c2dda6949e1d9bbe5 Mon Sep 17 00:00:00 2001 From: Aaron Jorbin Date: Tue, 29 Jun 2021 18:45:56 +0000 Subject: [PATCH] Docs: Further Improve documentation for wp_should_load_separate_core_block_assets(). In [51256], the documentation was improved, this further improves it. As scripts are not yet a part of what this function does, they are not mentioned explicitly. Assets is used so that the docs don't need a lot of improvements when scripts do come into play.. Props desrosj, SergeyBiryukov, Jorbin. See #53505. Built from https://develop.svn.wordpress.org/trunk@51263 git-svn-id: http://core.svn.wordpress.org/trunk@50872 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/script-loader.php | 20 +++++++++++--------- wp-includes/version.php | 2 +- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php index fa06871b7b..23fe1166f7 100644 --- a/wp-includes/script-loader.php +++ b/wp-includes/script-loader.php @@ -2326,16 +2326,16 @@ function wp_should_load_block_editor_scripts_and_styles() { } /** - * Checks whether separate assets should be loaded for core blocks on-render. + * Checks whether separate styles 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. + * only load their assets on-render, and each block loads its own, individual + * assets. Third-party blocks only load their assets when rendered. * - * When this function returns false, all core block styles are loaded regardless + * When this function returns false, all core block assets 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. + * the `block-library/style.css` file. Assets for third-party blocks are always + * enqueued regardless of whether they are rendered or not. * * This only affects front end and not the block editor screens. * @@ -2352,13 +2352,15 @@ function wp_should_load_separate_core_block_assets() { } /** - * Filters the flag that decides whether separate scripts and styles - * will be loaded for core blocks on-render. + * Filters whether block styles should be loaded separately. + * + * Returning false loads all core block assets, regardless of whether they are rendered + * in a page or not. Returning true loads core block assets only when they are rendered. * * @since 5.8.0 * * @param bool $load_separate_assets Whether separate assets will be loaded. - * Default false. + * Default false (all block assets are loaded, even when not used). */ return apply_filters( 'should_load_separate_core_block_assets', false ); } diff --git a/wp-includes/version.php b/wp-includes/version.php index 2f39112663..73f523e01c 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.8-beta4-51262'; +$wp_version = '5.8-beta4-51263'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.