Created
August 16, 2021 10:54
-
-
Save flyingwebie/73f8c96df8f3c20a0f94952a3475a25a to your computer and use it in GitHub Desktop.
Disable Gutenberg on Front End
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Fully Disable Gutenberg editor. | |
add_filter('use_block_editor_for_post_type', '__return_false', 10); | |
// Don't load Gutenberg-related stylesheets. | |
add_action( 'wp_enqueue_scripts', 'remove_block_css', 100 ); | |
function remove_block_css() { | |
wp_dequeue_style( 'wp-block-library' ); // Wordpress core | |
wp_dequeue_style( 'wp-block-library-theme' ); // Wordpress core | |
wp_dequeue_style( 'wc-block-style' ); // WooCommerce | |
wp_dequeue_style( 'storefront-gutenberg-blocks' ); // Storefront theme | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment