By default, depending on your theme, custom post types will still use the classic post editor in WordPress.
If you are wanting to force blocks (the gutenberg editor) on your custom post type, it is actually SUPER easy.
There are plugins that will do this for you, but if you are like me, and like to limit plugins as much as possible, then here is your simple solution. Yes, it is actually only one line of code in your setup of your custom post type.
Here is what a normal custom post type could look like (this isn’t using all of the features, but this is how I do most of my CPT’s)
add_action( 'init', 'tips_post_type' ); function tips_post_type() { register_post_type( 'Tips', array( 'labels' => array( 'name' => __( 'Tips', 'kembel' ), 'singular_name' => __( 'Tip', 'kembel' ), ), 'exclude_from_search' => false, 'has_archive' => true, 'hierarchical' => true, 'capability_type' => 'page', 'menu_icon' => 'http://kembel.ca/favicon.ico', 'public' => true, 'rewrite' => array( 'slug' => 'tips' ), 'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'trackbacks', 'custom-fields', 'comments', 'revisions', 'page-attributes', 'genesis-seo' ), ) ); }
Notice in the ‘Supports’ => Array area, that we are adding support for ‘editor’.
You need to make sure this is set, but it should be set already anyways for most CPT’s.
Right above the line for Supports, we want to add this line:
'show_in_rest' => true,
This will now allow the custom post type to use the blocks (gutenberg) editor in the back end of WordPress.