diff --git a/src/wp-includes/script-loader.php b/src/wp-includes/script-loader.php
index fa06871b7b..102f2b50e4 100644
a
|
b
|
function wp_should_load_block_editor_scripts_and_styles() { |
2326 | 2326 | } |
2327 | 2327 | |
2328 | 2328 | /** |
2329 | | * Checks whether separate assets should be loaded for core blocks on-render. |
| 2329 | * Checks whether separate scripts and styles should be loaded for core blocks on-render. |
2330 | 2330 | * |
2331 | 2331 | * When this function returns true, other functions ensure that core blocks |
2332 | | * only load their styles on-render, and each block loads its own, individual |
2333 | | * stylesheet. Third-party blocks only load their styles when rendered. |
| 2332 | * only load their assets on-render, and each block loads its own, individual |
| 2333 | * assets. Third-party blocks only load their assets when rendered. |
2334 | 2334 | * |
2335 | | * When this function returns false, all core block styles are loaded regardless |
| 2335 | * When this function returns false, all core block assets are loaded regardless |
2336 | 2336 | * of whether they are rendered in a page or not, because they are all part of |
2337 | | * the `block-library/style.css` file. Third-party blocks always get enqueued |
2338 | | * regardless of whether they are rendered or not. |
| 2337 | * the `block-library/style.css` file. Assets for third-party blocks are always |
| 2338 | * enqueued regardless of whether they are rendered or not. |
2339 | 2339 | * |
2340 | 2340 | * This only affects front end and not the block editor screens. |
2341 | 2341 | * |
… |
… |
function wp_should_load_separate_core_block_assets() { |
2352 | 2352 | } |
2353 | 2353 | |
2354 | 2354 | /** |
2355 | | * Filters the flag that decides whether separate scripts and styles |
2356 | | * will be loaded for core blocks on-render. |
| 2355 | * Filters whether block scripts and styles should be loaded separately. |
| 2356 | * |
| 2357 | * Returning false loads all core block assets, regardless of whether they are rendered |
| 2358 | * in a page or not. Returning true loads core block assets only when they are rendered. |
2357 | 2359 | * |
2358 | 2360 | * @since 5.8.0 |
2359 | 2361 | * |
2360 | 2362 | * @param bool $load_separate_assets Whether separate assets will be loaded. |
2361 | | * Default false. |
| 2363 | * Default false (all block assets are loaded, even when not used). |
2362 | 2364 | */ |
2363 | 2365 | return apply_filters( 'should_load_separate_core_block_assets', false ); |
2364 | 2366 | } |