[wp-trac] [WordPress Trac] #48885: REST API: Add a route to read and update separate site settings

WordPress Trac noreply at wordpress.org
Tue Dec 17 03:14:16 UTC 2019


#48885: REST API: Add a route to read and update separate site settings
--------------------------------------------------+---------------------
 Reporter:  scruffian                             |       Owner:  (none)
     Type:  enhancement                           |      Status:  new
 Priority:  normal                                |   Milestone:  5.4
Component:  REST API                              |     Version:
 Severity:  normal                                |  Resolution:
 Keywords:  has-patch has-unit-tests 2nd-opinion  |     Focuses:
PR Number:                                        |
--------------------------------------------------+---------------------

Comment (by pento):

 Replying to [comment:10 TimothyBlynJacobs]:
 > At that point, is there a benefit to consolidating everything into a
 single endpoint?

 Yup, that's the benefit: one endpoint, rather than two endpoints. This
 isn't specific to Gutenberg (which has WordPress experts working on it),
 this is about ensuring the data is available in the most logical location
 for any developer who wants to use this endpoint.

 > Switching how we format a value based on the context would be a new
 pattern I believe. I can't think of an example of us doing that in core,
 and couldn't find any doing a brief search. Currently you can request the
 "maximum" level of context available to you, and retrieve access to all
 data. I'm not opposed to it, but I wanted to document that.

 It's not quite the same, but this is an example of a value changing based
 on the context. Given a post with a post password set on it, and the
 password is not sent in the `GET` request for that post,
 `content.rendered` on the returned post object will be empty in the `view`
 context, and populated correctly in the `edit` context.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/48885#comment:11>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list