[wp-trac] [WordPress Trac] #39854: REST API: Add gmt_offset to base /wp-json response
WordPress Trac
noreply at wordpress.org
Sun Feb 12 15:57:28 UTC 2017
#39854: REST API: Add gmt_offset to base /wp-json response
-------------------------+-----------------
Reporter: jnylen0 | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: 4.8
Component: REST API | Version: 4.7
Severity: normal | Keywords:
Focuses: rest-api |
-------------------------+-----------------
API clients often have a need to retrieve information about the current
site. This doesn't fit into the `wp/v2/settings` endpoint for a couple of
reasons:
- That endpoint requires administrative privileges (`current_user_can(
'manage_options' )`). See also #38731.
- We decided not to implement finer-grained permissions on the settings
endpoint, as a read-only piece of information isn't a read/write
"setting". See also ticket:38490#comment:10.
The most immediately obvious piece of information to add is `gmt_offset`.
This is a crucial piece of information for any clients that need to
manipulate datetimes returned via the API, but it's not currently
available anywhere. See also ticket:38342#comment:48 for the specific
case of Quick Draft inside wp-admin.
I expect we will need to enhance the base `/wp-json` response to accept a
`?context=edit` or similar parameter - so let's use this ticket for both
the approach to `/wp-json` and the addition of the `gmt_offset` field
specifically.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/39854>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list