Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gutenberg is gone for CPTs when the "editor" option is missing from the "supports" argument #5603

Closed
kmgalanakis opened this issue Mar 14, 2018 · 1 comment
Labels
Backwards Compatibility Issues or PRs that impact backwards compatability

Comments

@kmgalanakis
Copy link

When creating a CPT, in order to enable Gutenberg for it we need to set show_in_rest to true.

Unfortunately, even though show_in_rest is set to true, the editor UI reverts back to the classic editor when the editor option is omitted from the supports CPT argument.

To test this use the simple code below:

function create_posttype() {
 
    register_post_type( 'movies',
    // CPT Options
        array(
            'labels' => array(
                'name' => __( 'Movies' ),
                'singular_name' => __( 'Movie' )
            ),
            'public' => true,
            'has_archive' => true,
            'rewrite' => array('slug' => 'movies'),
			'show_in_rest' => true,
			'supports'  => array( 'title' )
        )
    );
}
add_action( 'init', 'create_posttype' );

I know that it actually makes complete sense but imagine having only custom fields for a CPT. This will confuse users to see the classic editor.

Also, what would happen when GB is merged into the core?

@kmgalanakis kmgalanakis changed the title Gutenberg is gone for CPT when the "editor" option is missing from the "supports" argument Gutenberg is gone for CPTs when the "editor" option is missing from the "supports" argument Mar 14, 2018
@mtias mtias added the Backwards Compatibility Issues or PRs that impact backwards compatability label Mar 14, 2018
@mtias
Copy link
Member

mtias commented Mar 14, 2018

This was intentional as gutenberg is an editing optimized view while the majority of the feedback we got was that post types that didn't require the visual editor should continue to work as they do now in wp-admin.

Going to close but thanks for the point of feedback as it might become relevant for the 5.0 roadmap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backwards Compatibility Issues or PRs that impact backwards compatability
Projects
None yet
Development

No branches or pull requests

2 participants