[wp-trac] [WordPress Trac] #42785: Change default of `show_in_rest` in register_post_type and register_taxonomy
WordPress Trac
noreply at wordpress.org
Fri Mar 30 18:44:43 UTC 2018
#42785: Change default of `show_in_rest` in register_post_type and
register_taxonomy
-------------------------------------------------+-------------------------
Reporter: joehoyle | Owner: pento
Type: enhancement | Status: assigned
Priority: normal | Milestone: 4.9.6
Component: REST API | Version:
Severity: normal | Resolution:
Keywords: has-patch needs-unit-tests needs- | Focuses:
refresh |
-------------------------------------------------+-------------------------
Comment (by youknowriad):
Awesome thanks @danielbachhuber These links are indeed very helpful to
understand the whole picture and I agree with the compromises made at that
time.
> If we want to transition WordPress to an API-driven world, we need a
better plan than default show_in_rest=true and hope there's no impact.
I think it's not "if we want" anymore, WordPress is transitioning to an
API-driven world with Gutenberg.
So, it's better we start planning for this now. I propose we define for
each entity what's public, what's not, what capability is needed to see
any field. Once done we can add ways for people to force
capabilities/roles by fields if possible (for example we can't force the
post title, content to be private in APIs for public CPTs), include
deprecation warnings and clarify these changes, leave them for some
releases and start updating. I also think this is not specific to the REST
API, the REST API is just one API, the same considerations concern any
other type of API. Imagine we add GraphQL, how do we define which property
needs which capability since we can't use a global `show_in_rest`, GraphQL
requests being per field...
I guess we could discuss these things in the weekly meetings unless you
think this is set in stone.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/42785#comment:28>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list