• Resolved James Joseph Finn

    (@jamesjosephfinn)


    Hello Jeff; hope you’re well.

    “Enable Frontend” is not checked, but frontend is still making requests for /wp-includes/css/dist/block-library/style.min.css. Using Bricks + AutomaticCSS. Presumably they’re overriding your dequeue? Can’t link the site because it’s intranet for the time being.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Jeff Starr

    (@specialk)

    Hi James, it sounds like something happening due to one of the other plugins. If you can provide steps to repeat the issue just with DG plugin, I can take a look and try to resolve any issue asap, thank you.

    Thread Starter James Joseph Finn

    (@jamesjosephfinn)

    @specialk Roger that. I’ll have to look into it then. Thanks for confirming that this is not the expected behavior; and thank you also for the prompt reply, and the great tool! Have a good one!

    Thread Starter James Joseph Finn

    (@jamesjosephfinn)

    For posterity and prosperity: Bricks Builder does indeed override Jeff’s dequeue, so hooking into wp_enqueue_scripts with the usual wp_dequeue_style won’t work; instead, hook into init, and use wp_deregister_style. No priority param needed. This successfully nukes /wp-includes/css/dist/block-library/style.min.css from loading on the frontend of a Bricks website.

    /*
    * https://metabox.io/disable-gutenberg-without-using-plugins/#how-to-disable-gutenberg-with-code
    * https://wp-kama.com/function/wp_deregister_style
    * https://forum.bricksbuilder.io/t/wait-bricks-scripts-can-call-disable-css-style-sheet/11094#post_3
    * https://forum.bricksbuilder.io/t/wip-gutenberg-block-styles-reduce-unused-css/28139
    */

    add_action( 'init', function() {
    // Remove CSS on the front end.
    wp_deregister_style( 'wp-block-library' );

    // Remove Gutenberg theme.
    wp_deregister_style( 'wp-block-library-theme' );

    // Remove inline global CSS on the front end.
    wp_deregister_style( 'global-styles' );

    // Remove classic-themes CSS for backwards compatibility for button blocks.
    wp_deregister_style( 'classic-theme-styles' );
    });

    Thank you @specialk for the hint!

    Pax et bonum.

    Plugin Author Jeff Starr

    (@specialk)

    Good to know, thank you for explaining and sharing a solution.

    Cheers James and best to you and your WP projects.

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

The topic ‘Block Styles Still Loading’ is closed to new replies.