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.
@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!
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.
Good to know, thank you for explaining and sharing a solution.
Cheers James and best to you and your WP projects.