Disable Gutenberg for Custom Post Types

This WordPress file modifies the editor experience by disabling the Gutenberg editor for all custom post types, ensuring that only the classic editor is used. It maintains the use of the Gutenberg editor for standard posts, providing a selective experience based on the post type.

<?php function cwpai_disable_gutenberg_for_certain_post_types($can_edit, $post_type) { if ($post_type !== 'post') { return false; } return $can_edit; } add_filter('use_block_editor_for_post_type', 'cwpai_disable_gutenberg_for_certain_post_types', 10, 2);

Frequently Asked Questions

This code disables the Gutenberg editor for all post types except for the standard 'post' type in WordPress.