[wp-trac] [WordPress Trac] #42785: Change default of `show_in_rest` in register_post_type and register_taxonomy

WordPress Trac noreply at wordpress.org
Sun Dec 3 19:34:16 UTC 2017


#42785: Change default of `show_in_rest` in register_post_type and
register_taxonomy
-------------------------+-------------------
 Reporter:  joehoyle     |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  4.9.2
Component:  REST API     |    Version:
 Severity:  normal       |   Keywords:
  Focuses:               |
-------------------------+-------------------
 Right now `show_in_rest` is defaulted to `false` in `register_post_type`
 and `register_taxonomy`. To improve usefulness of the REST API I think the
 time has come to include default publicly readable data into the REST APi.

 This helps with
 https://github.com/WordPress/gutenberg/issues/1342#issuecomment-319920850
 for Gutenberg too.

 I propose we default `show_in_rest` to `true` in the following scenarios:

 - Object types registered with `public => true` (only).
 - Object types registered with `publicly_queryable => true`.

 I have other future ideas for further cases (including authenticated-only
 cases) but I think this is a good start.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/42785>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list