[wp-trac] [WordPress Trac] #50328: Enqueue script and style assets only for blocks present on the page

WordPress Trac noreply at wordpress.org
Tue May 11 16:48:20 UTC 2021


#50328: Enqueue script and style assets only for blocks present on the page
-------------------------------------------------+-------------------------
 Reporter:  aduth                                |       Owner:  gziolo
     Type:  enhancement                          |      Status:  reopened
 Priority:  normal                               |   Milestone:  5.8
Component:  Editor                               |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch has-unit-tests commit      |     Focuses:  javascript
  needs-dev-note                                 |
-------------------------------------------------+-------------------------
Changes (by SergeyBiryukov):

 * status:  closed => reopened
 * resolution:  fixed =>


Comment:

 When reviewing [50836], I've noticed that we have a similarly named
 function and filter in `script-loader.php`:

 * The `wp_should_load_block_editor_scripts_and_styles()` function.
 * The `should_load_block_editor_scripts_and_styles` filter (same, but
 without the `wp_` prefix).

 Would it make sense to rename `should_load_separate_core_block_assets()`
 to match that for consistency? That would be:

 * The `wp_should_load_separate_core_block_assets()` function.
 * The `should_load_separate_core_block_assets` filter.

 See also [49080] & [49093] / #51330 for more context.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/50328#comment:32>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list