Created
September 17, 2021 13:59
-
-
Save dustinleer/70c96717cdbafabcf3e4d799dd99171c to your computer and use it in GitHub Desktop.
Disables Gutenberg for the Widget Area in WordPress
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
// Disables the block editor from managing widgets in the Gutenberg plugin. | |
add_filter( 'gutenberg_use_widgets_block_editor', '__return_false', 100 ); | |
// Disables the block editor from managing widgets. | |
add_filter( 'use_widgets_block_editor', '__return_false' ); | |
if ( ! function_exists( 'themename_activate_classic_widgets' ) ) : | |
function themename_activate_classic_widgets() { | |
remove_theme_support( 'widgets-block-editor' ); | |
} | |
endif; | |
add_action( 'after_setup_theme', 'themename_activate_classic_widgets' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment