[wp-trac] [WordPress Trac] #39954: REST API: Improve date updates if both `date` and `date_gmt` are set

WordPress Trac noreply at wordpress.org
Thu Feb 23 19:51:42 UTC 2017


#39954: REST API: Improve date updates if both `date` and `date_gmt` are set
-------------------------+-----------------------------
 Reporter:  jnylen0      |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  REST API     |    Version:  4.7
 Severity:  normal       |   Keywords:
  Focuses:               |
-------------------------+-----------------------------
 Currently, if you set both the `date` and `date_gmt` fields when creating
 or updating a [https://core.trac.wordpress.org/browser/tags/4.7.2/src/wp-
 includes/rest-api/endpoints/class-wp-rest-posts-controller.php#L996 post]
 or [https://core.trac.wordpress.org/browser/tags/4.7.2/src/wp-includes
 /rest-api/endpoints/class-wp-rest-comments-controller.php#L1119 comment],
 the `date` field will take precedence and the `date_gmt` field will be
 ignored.

 This behavior isn't ideal because when either of these two dates is
 specified, the other is also updated based on the site's timezone offset.

 If both `date` and `date_gmt` are specified, '''and''' the two values do
 not match according to the site's current timezone offset, there are a
 couple of options for improving the behavior:

 - Update the date fields exactly as requested, even though they will not
 match the site's current timezone offset.
 - Return an error.

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


More information about the wp-trac mailing list