• I noticed a change (Block CSS is now only loaded on pages that include a sitemap block.) in the latest version (3.5.6) breaks CSS on sites running WordPress 6.0.1.

    Specifically this change seems to remove the wp-block-library-css from being loaded in the <head> and instead loads inline styles in the <footer>. This can cause issues with themes that override styles in the block editor with their own custom styles.

    It looks like this issue is caused by this filter added in (3.5.6):
    add_filter( 'should_load_separate_core_block_assets', '__return_true' );

    I’ve fixed this issue in my theme by placing the following filter in my functions.php:

    /* Set all block assets to be loaded */
    //This overrides a filter set in "Simple Sitemap" plugin
    //https://developer.wordpress.org/reference/hooks/should_load_separate_core_block_assets/
    
    add_filter( 'should_load_separate_core_block_assets', '__return_false' );

    Personally I feel like this functionality should be optional in the plugin, perhaps it can be toggled off by default and could be enabled by users in the UI.

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Recent filter added breaks CSS’ is closed to new replies.