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:
- How to get the post title inside a custom block in a loop? block.js
- Set custom post type to load custom block pattern by default
- 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
- Gutenberg block – Save PHP function’s output as HTML?
- 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
- 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()
- Manipulating the allowed inner blocks of a core-gutenberg-block?
- Custom post type removing /page/2/ from URL when trying to access it
- Same Custom Post Type Slug and Custom Taxonomy Slug, with hierarchial unique permalink structure
- fetch from an external api call and display results in page
- WordPress CPT & Custom Taxonomy with the SAME Permalink Structure
- Adding features to Gutenberg without theme.json
- Registering a custom block style
- Remove slug and custom post type name from URL
- Hot to show custom post type taxonomies on archive page
- Integrate a Custom Post Type with Learndash Plugin
- child category under correct parent
- Get column block count using PHP method render_block
- Remove slug of multiple custom post types with and without hierarchical
- do_blocks not working with a custom block
- Redirect WordPress page to the latest created post by the logged in author/user
- create custom post type and populate custom fields using php
- Want to add custom post type for facebook feed
- How to edit templates created in the block editor in code / template files not updating
- Programmatically convert single classic block to individual blocks via PHP
- Add custom data attribute to every core Gutenberg Blocks
- Embed dynamic media query in a Gutenberg block
- Get generated block styles programmatically
- Custom Post Types in WordPress Dashboard List Rows But Data is Blank
- Options of select field in a custom divi module ignore sorting
- How to Customize the Admin Sidebar Menu in WordPress Multisite Network by changing the backend code of the wp-admin code files?
- When a foreach loop is used multiple times in blocks, is there a way to ensure a variable always has a unique value?
- How to display only the first 2 words of a post title
- How to get the content of a dynamic block in PHP
- Post returns 404 after changing the permalink using post_type_link