I tried many methods to fix this but with no results. Does anybody know how to init the Gutenberg editor on a custom admin page? I’m really in need of fixing it since I can’t update the posts. Any help is welcomed.
Start by registering a Gutenberg WordPress custom type. The process is fairly easy and involves adding the following the code snippet.
/*Register WordPress Gutenberg CPT */
function cw_post_type() {
register_post_type( 'portfolio',
// WordPress CPT Options Start
array(
'labels' => array(
'name' => __( 'Portfolio' ),
'singular_name' => __( 'Portfolio' )
),
'has_archive' => true,
'public' => true,
'rewrite' => array('slug' => 'portfolio'),
'show_in_rest' => true,
'supports' => array('editor')
)
);
}
add_action( 'init', 'cw_post_type' );
add the show_in_rest key and set it to true via your custom post type.