how to disable gutenberg 2f block editor for certain post types

Solutions on MaxInterview for how to disable gutenberg 2f block editor for certain post types by the best coders in the world

showing results for - "how to disable gutenberg 2f block editor for certain post types"
Elyne
22 Oct 2020
1	add_filter( 'use_block_editor_for_post_type', 'prefix_disable_gutenberg', 10, 2 );
2	function prefix_disable_gutenberg( $current_status, $post_type ) {
3		// Use your post type key instead of 'page or post'
4		if ( in_array( $post_type, array( 'page', 'post' ) ) ) {
5			return false;
6		}
7		return $current_status;
8	}