Gutenberg is the new editor in WordPress 5.0. But Gutenberg is not automatically enable to custom post types, they still use the old editor/classic editor. It might be automatically enabled in the future but for now a slight code adjustment is needed.
Here’s an example:
add_action( 'init', 'prefix_cpt_init' );
function prefix_cpt_init() {
$labels = array(
// not revelant for this article
);
$args = array(
'labels' => $labels,
'description' => __( 'Description.', 'textdomain' ),
'public' => true,
'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments' )
);
register_post_type( 'mycpt', $args );
}
All we need to do is set show_in_rest to true, like this:
add_action( 'init', 'prefix_cpt_init' );
function prefix_cpt_init() {
$labels = array(
// not revelant for this article
);
$args = array(
'labels' => $labels,
'description' => __( 'Description.', 'textdomain' ),
'public' => true,
'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments' ),
'show_in_rest' => true,
);
register_post_type( 'mycpt', $args );
}
Basically enables the REST API for the custom post type, which is needed for the post add/edit page and Gutenberg to function.