Make WordPress Core

Changeset 51256


Ignore:
Timestamp:
06/29/2021 11:10:33 AM (2 years ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/script-loader.php

    r51227 r51256  
    23292329 * Checks whether separate assets should be loaded for core blocks on-render.
    23302330 *
     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.
     2334 *
     2335 * When this function returns false, all core block styles are loaded regardless
     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.
     2339 *
     2340 * This only affects front end and not the block editor screens.
     2341 *
     2342 * @see wp_enqueue_registered_block_scripts_and_styles()
     2343 * @see register_block_style_handle()
     2344 *
    23312345 * @since 5.8.0
    23322346 *
Note: See TracChangeset for help on using the changeset viewer.