[wp-trac] [WordPress Trac] #39854: REST API: Add gmt_offset to base /wp-json response

WordPress Trac noreply at wordpress.org
Mon Mar 27 07:08:56 UTC 2017


#39854: REST API: Add gmt_offset to base /wp-json response
--------------------------------------------------+-----------------------
 Reporter:  jnylen0                               |       Owner:  jnylen0
     Type:  enhancement                           |      Status:  closed
 Priority:  normal                                |   Milestone:  4.7.4
Component:  REST API                              |     Version:  4.7
 Severity:  normal                                |  Resolution:  fixed
 Keywords:  has-patch has-unit-tests fixed-major  |     Focuses:  rest-api
--------------------------------------------------+-----------------------
Changes (by swissspidy):

 * status:  reopened => closed
 * resolution:   => fixed


Comment:

 In [changeset:"40336"]:
 {{{
 #!CommitTicketReference repository="" revision="40336"
 REST API: Add `gmt_offset` and `timezone_string` to the base `/wp-json`
 response.

 The site's current timezone offset is an important piece of information
 for any REST API client that needs to manipulate dates.  It has not been
 previously available.

 Expose both the `gmt_offset` (the site's current offset from UTC in hours)
 and `timezone_string` (which also provides information about daylight
 savings time) via the "site info" endpoint (the base `/wp-json` response).

 Also update the `wp-api-generated.js` fixture file with the changes to the
 default API responses.

 Props sagarkbhatt.
 Fixes #39854.

 Merges [40238] to the 4.7 branch.
 }}}

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


More information about the wp-trac mailing list