Make WordPress Core

Opened 11 months ago

Closed 11 months ago

Last modified 9 months ago

#59862 closed defect (bug) (wontfix)

should_load_separate_core_block_assets filter no longer forces loading of block styles

Reported by: domainsupport's profile domainsupport Owned by:
Milestone: Priority: normal
Severity: normal Version: 6.4
Component: Script Loader Keywords:
Focuses: css Cc:

Description

We use the following code in v6.3.2 and earlier to force the loading of /wp-includes/css/dist/block-library/style.min.css so that manually inserted blocks such as the Cover block or Columns block (via custom shortcodes) can still benefit from their block styles ...

add_action('setup_theme', 'my_setup_theme');

function my_setup_theme() {

         add_filter('should_load_separate_core_block_assets', '__return_false');

}

This no longer works in v6.4.1 and /wp-includes/css/dist/block-library/style.min.css is not loaded.

We are using Twenty Twenty-Two theme.

Change History (2)

#1 @domainsupport
11 months ago

  • Resolution set to wontfix
  • Status changed from new to closed

I've found a fix for this whereby adding a priority of 11 to the filter allows this to work again.

<?php
add_action('setup_theme', 'my_setup_theme');

function my_setup_theme() {

         add_filter('should_load_separate_core_block_assets', '__return_false', 11);

}

I'm going to add my findings to the notes for the filter https://developer.wordpress.org/reference/hooks/should_load_separate_core_block_assets/

#2 @swissspidy
9 months ago

  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.