enable-gutenberg-on-custom-post-type

Enable Gutenberg on Custom Post Types

Gutenberg is the new content editor in WordPress. But it’s not automatically applied to custom post types, they still use the classic editor. It might be automatically applied in the future but for now a slight code adjustment is needed.

Here’s an example:

All we need to do is set show_in_rest to true, like this:

Basically what that does is enables the REST API for the custom post type, which is needed for the post add/edit page and Gutenberg to function.

Tags: ,
 
Next Post
add-custom-class-body-wordpress
WPDev101

Adding Custom Classes to the Body Tag in WordPress

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.