Gutenberg: Custom post types without `show_in_rest` cannot load editor

Created on 19 Oct 2017  路  4Comments  路  Source: WordPress/gutenberg

Previously: https://github.com/WordPress/gutenberg/issues/1342#issuecomment-319920850

This has been known and I assumed there was an issue, but a major blocking issue to relying on the REST API for building a post editor is that a custom post type must explicitly opt in to being available through the REST API, and therefore Gutenberg cannot load correctly otherwise.

Options for moving forward:

Core REST API Task [Feature] Extensibility [Type] Plugin Interoperability

Most helpful comment

_Cross-posting from the Trac ticket_.

I'm unconvinced that show_in_rest should become opt-out instead of opt-in.

Given custom post types probably have custom editor UI (metaboxes and otherwise), it seems unlikely that Gutenberg will be a drop-in replacement for the existing UI. Also, I'm concerned we'd unintentionally expose data we don't mean to expose.

Lastly, such a significant change certainly shouldn't be in a minor release.

For the purposes of Gutenberg, loading the Classic Editor for post types with show_in_rest=false seems sufficient to me.

All 4 comments

I created https://core.trac.wordpress.org/ticket/42785 to get some progress on better defaults for content included in the REST API. This doesn't quite address all the cases here such as "private" post types, which I think we can also push ahead.

_Cross-posting from the Trac ticket_.

I'm unconvinced that show_in_rest should become opt-out instead of opt-in.

Given custom post types probably have custom editor UI (metaboxes and otherwise), it seems unlikely that Gutenberg will be a drop-in replacement for the existing UI. Also, I'm concerned we'd unintentionally expose data we don't mean to expose.

Lastly, such a significant change certainly shouldn't be in a minor release.

For the purposes of Gutenberg, loading the Classic Editor for post types with show_in_rest=false seems sufficient to me.

I'm unconvinced that show_in_rest should become opt-out instead of opt-in.

Given custom post types probably have custom editor UI (metaboxes and otherwise), it seems unlikely that Gutenberg will be a drop-in replacement for the existing UI. Also, I'm concerned we'd unintentionally expose data we don't mean to expose.
[snip]
For the purposes of Gutenberg, loading the Classic Editor for post types with show_in_rest=false seems sufficient to me.

I personally agree with the above reasoning, it seems that falling back to the Classic Editor for post_types not supporting show_in_rest is the most compatible and perhaps expected behaviour here.

That means that this has been fixed by 5390ea2c98b76905abe0bab5b8eaeed0a3576aa0 & #3146

Going to close this in preference for https://core.trac.wordpress.org/ticket/42785 - Gutenberg acts correctly here, when/if cores defaults change those post_types will pick up Gutenberg if the other conditions are met.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

maddisondesigns picture maddisondesigns  路  3Comments

youknowriad picture youknowriad  路  3Comments

moorscode picture moorscode  路  3Comments

ellatrix picture ellatrix  路  3Comments

aaronjorbin picture aaronjorbin  路  3Comments