[wp-trac] [WordPress Trac] #38883: Shim post_date_gmt for drafts / empty dates in the REST API

WordPress Trac noreply at wordpress.org
Sun Nov 20 21:24:08 UTC 2016


#38883: Shim post_date_gmt for drafts / empty dates in the REST API
--------------------------+-----------------------------
 Reporter:  joehoyle      |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  REST API      |    Version:
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 For reasons that we won't get into here, post dates for drafts in
 WordPress only stores the `post_date` field, but not the `date_gmt_field`
 - that one doesn't get set up a post is published. In the context of the
 REST API the `date_gmt` field is most useful to show dates in the timezone
 of the viewer - only having the `date` field in drafts makes it very
 difficult for a REST API client to show true dates to their users.

 We have thus far opted to set the `date_gmt` field to `null` in the case
 of it being set to an all-zero date in the database. Unfortunately, this
 is an annoying WordPress inconsistency that affects REST API users.

 I'm not sure whether we should be fixing this at the API level, but it's
 come up a few times with discussion with @jnylen, so this ticket exists as
 a place to discuss and see if we can solve this for API users.

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


More information about the wp-trac mailing list