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

WordPress Trac noreply at wordpress.org
Fri Feb 24 18:14:23 UTC 2017


#38883: Shim post_date_gmt for drafts / empty dates in the REST API
---------------------------------------------+----------------------
 Reporter:  joehoyle                         |       Owner:  jnylen0
     Type:  defect (bug)                     |      Status:  closed
 Priority:  normal                           |   Milestone:  4.7.3
Component:  REST API                         |     Version:  4.7
 Severity:  normal                           |  Resolution:  fixed
 Keywords:  has-unit-tests has-patch commit  |     Focuses:
---------------------------------------------+----------------------
Changes (by jnylen0):

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


Comment:

 In [changeset:"40108"]:
 {{{
 #!CommitTicketReference repository="" revision="40108"
 REST API: Shim `post_date_gmt` for drafts / empty dates in the REST API.

 Internally, WordPress uses a special `post_date_gmt` value of `0000-00-00
 00:00:00` to indicate that a draft's date is "floating" and should be
 updated whenever the post is saved.  This makes it much more difficult for
 API clients to know the correct date of a draft post.

 This commit provides a best guess at a `date_gmt` value for draft posts in
 this situation using the `date` field and the site's current timezone
 offset.

 Props joehoyle.
 Fixes #38883.
 }}}

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


More information about the wp-trac mailing list