In this tutorial, we will see how to enable the new Gutenberg editor in our Custom Post Types.
First we must go to the file where it belongs to our Custom Post Type, in the type path:
Domain.com -> wp-content -> plugins -> CPT> custom_post_type.php
Edit the php file, which will have a similar similarity to the following Custom Post Type of Courses:
add_action ('init', 'create_a_cpt'); function create_a_cpt () { $ args = array ( 'public' => true, 'label' => 'Courses', ' menu_icon '=>' dashicons-info ', ' has_archive '=> true, ' capability_type '=>' post ', ' menu_position '=> 2, ' show_in_rest '=> true, ); register_post_type ('courses', $ args); }
Well, we must add the argument of:
'show_in_rest' => true,
This will make the classic editor of all life in WordPress, is transformed into the new editor of Gutenberg, as we have in the Posts of our site.