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

WordPress Trac noreply at wordpress.org
Mon Nov 21 20:13:25 UTC 2016


#38883: Shim post_date_gmt for drafts / empty dates in the REST API
--------------------------------------+------------------------------
 Reporter:  joehoyle                  |       Owner:  rmccue
     Type:  defect (bug)              |      Status:  reviewing
 Priority:  normal                    |   Milestone:  Awaiting Review
Component:  REST API                  |     Version:
 Severity:  normal                    |  Resolution:
 Keywords:  has-unit-tests has-patch  |     Focuses:
--------------------------------------+------------------------------

Comment (by jnylen0):

 > Why not use the post status to determine if post_date gets updated? if
 the post is in a draft state we would update the post_date on every
 update?

 This seems pretty reasonable to me.

 If a GMT date is updated for a draft, we can either assume or verify that
 the corresponding `post_*_gmt` field is all zeroes, then make the
 requested change to the non-GMT field instead (backing out the site's
 timezone offset).

 If both `date` and `date_gmt` are specified in an update, and it's a
 draft, and this would lead to different values for the date... I guess
 that should probably be an error.

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


More information about the wp-trac mailing list