[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 22:02:50 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 fixed-major  |     Focuses:
--------------------------------------------------+----------------------
Changes (by SergeyBiryukov):

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


Comment:

 In [changeset:"40115"]:
 {{{
 #!CommitTicketReference repository="" revision="40115"
 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, jnylen0.
 Merges [40108] to the 4.7 branch.
 Fixes #38883.
 }}}

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


More information about the wp-trac mailing list