This code should do the trick. You will just need to add the post type(s) to the line below.
function my_disable_gutenberg( $current_status, $post_type ) {
// Disabled post types
$disabled_post_types = array( 'book', 'movie' );
// Change $can_edit to false for any post types in the disabled post types array
if ( in_array( $post_type, $disabled_post_types, true ) ) {
$current_status = false;
}
return $current_status;
}
add_filter( 'use_block_editor_for_post_type', 'my_disable_gutenberg', 10, 2 );
Related Posts:
- Call to a member function add_rewrite_tag() on null
- How to serialize a Gutenberg block from block attributes in PHP?
- Removing Default Gutenberg Blocks, But Keeping Reusable Block Functionality?
- is_admin returning false in backend in server side rendered block
- Gutenberg Blocks doesn’t render correctly when using do_blocks
- add_meta_boxes action with refresh on save
- Gutenberg custom block using only register_block_type() and HTML
- Include a Gutenberg Block in a PHP file
- Create custom blocks for bootstrap
- How to return output of the new wp gallery block for automatically Link images To Media file
- How to add custom taxonomy slug in CPT permalink?
- Register JS for block on frontend only
- Displaying admin notices inside the block editor from rest_after_insert_{$this->post_type} hook
- How to programmatically add Gallery Block to Existing Post Content
- Best way to add more options to Gutenberg “More Rich” text controls drop down
- Fetch post block/field data as JSON with WordPress API
- Gutenberg block – Save PHP function’s output as HTML?
- Where to find documentation for CPT block template? (PHP)
- Generate YouTube image thumbnail in a Gutenberg block – ACF + Timber
- Add class to group inner container
- Multiple requests external data api dynamic block gutenberg
- How to keep the capability of users and disable Gutenberg editor in WordPress?
- parsing nested blocks (in columns, etc) via PHP
- Passing the name of selected color from the custom component to `render_callback`
- InnerBlocks with allowedBlocks not working with acf_register_block
- Guttenburg and Classic Editor – How to use the custom guttenburg block in classic editor?
- How to render a block from php template
- WordPress: Displaying all the post tags from within a specific taxonomy’s term
- Want to unrestrict plugin block
- WordPress – Get Posts with Category data
- Additional file upload in Gutenberg page options/featured image
- Add Block Before Entry Title Using PHP
- How to populate a Gutenberg select field SelectControl with option value from PHP array
- Gutenberg Blocks and get_option() for styling
- How to extend SelectControl with data from my theme
- Copying and pasting to WordPress “code editor” code via the front end and clipboard
- Gutenberg block don’t save rich text content
- Is there a PHP function that will return the block ID generated by WordPress?
- register_block_type is not working properly
- Categories does not show Block editor WordPress
- Block that renders html saved in a php file
- Show Gutenberg facebook embed with a custom theme
- Relationship between custom post type and page/single templates
- Display a query with multiple post types and same relationship on a single page
- Display all categories (with link) of custom post type – WordPress
- Gutenberg – render_callback does not pass ToggleControl value on frontend
- How can I get values from a custom post type depending on where I click on my SVG map?
- Add default block css when the block has been added with php?
- Displaying custom meta box value in a custom post page
- How to initialise WP_Query on the basis of a specific meta_value and continue iterating rest?
- Custom Post Type doesn’t have template content when creating programmatically in PHP but does when created in WP Admin
- WordPress different custom tag being displayed in on tag list
- How to add different menu items on different menus?
- Can I associate a custom post type with another custom post type?
- Get category name of current post (CPT UI)
- How to sort custom sortable column by custom table value
- I want to show image from custom field image on my custom page template
- How to disable page create for custom post type, but allow a page with the post types slug to be created?
- Replace block content with an array
- How to use multiple custom post types to archive as front page?
- Include a static block inside of a dynamic block
- How to make multiple custom taxonomies sit under custom post type slug?
- Limit a search box by CPT + taxonomies, in only one page
- WordPress taxonomy and terms question
- Load style and script for custom post type metabox
- Custom CPT – Programmatically create categories to assign CPT when a new one is created
- Why do I get a 404 error on my custom post type archive pagination?
- How do I exclude the current post from the upcoming post query
- Save_Post change Custom Post Type Post title to post id number
- Custom Filtering date with newsletter
- Ajax infinite scroll random order shows duplicate posts on custom post type
- WordPress Block Editor Gutenberg running code inside ! is_admin()
- Filter link to existing content suggestion
- How to strip non-alphanumeric characters, convert spaces to dashes, uppercase to lowercase in this context
- fallback image for featured image
- Add attribute / custom attribute to product in woocommerce
- How to create another version of my site based on the same database
- Why is this Ajax not working?
- Can’t get order_by meta_value_num to work properly
- Count the number of times the search form template gets included on a page
- Remove echo from shortcode
- Check IF single OR multiple custom data has been entered
- Woocommerce with Lazy Load php and ajax
- How to check $_GET isset for a parameter and value? [closed]
- Submitting a form, using Ajax, to run a SQL Select query based on user input from the form
- WPDB secure custom form
- setcookies and header send
- Insert content into head tag with function
- Getting text from custom field from customizer
- Create plugin with custom page and template caused an error `Call to undefined function get_header()`
- WordPress redirects to localhost
- Replace jQuery with PHP or CSS for Customized WordPress wp_nav_menu
- Show the subcategory name based on current product
- Getting an empty space in up sell items
- Stored meta from attachment, video length?
- Vertical Menu for one page only
- Create a custom theme-specific page, invisible in the admin-panel?
- Can’t pick up a field created with Advanced Custom Fields
- wp nav menu without label
- WXR XML import is stripping php tags that I need to keep