Skip to content

Instantly share code, notes, and snippets.

@dustinleer
Created September 17, 2021 13:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dustinleer/70c96717cdbafabcf3e4d799dd99171c to your computer and use it in GitHub Desktop.
Save dustinleer/70c96717cdbafabcf3e4d799dd99171c to your computer and use it in GitHub Desktop.
Disables Gutenberg for the Widget Area in WordPress
// 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