WordPress/wp-includes/rest-api/endpoints
James Nylen 78b298f0f3 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.

Built from https://develop.svn.wordpress.org/trunk@40108


git-svn-id: http://core.svn.wordpress.org/trunk@40045 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-24 18:15:44 +00:00
..
class-wp-rest-attachments-controller.php Docs: Correct rest_insert_* duplicate hook references in REST API. 2017-01-04 13:23:40 +00:00
class-wp-rest-comments-controller.php REST API: Unify object access handling for simplicity. 2017-01-26 13:39:41 +00:00
class-wp-rest-controller.php
class-wp-rest-post-statuses-controller.php REST API: Unify object access handling for simplicity. 2017-01-26 13:39:41 +00:00
class-wp-rest-post-types-controller.php REST API: Unify object access handling for simplicity. 2017-01-26 13:39:41 +00:00
class-wp-rest-posts-controller.php REST API: Shim post_date_gmt for drafts / empty dates in the REST API. 2017-02-24 18:15:44 +00:00
class-wp-rest-revisions-controller.php REST API: Cast revision author ID to int. 2017-02-16 20:09:45 +00:00
class-wp-rest-settings-controller.php Docs: Misc corrections and additions to inline documentation. 2016-12-27 09:28:40 +00:00
class-wp-rest-taxonomies-controller.php REST API: Unify object access handling for simplicity. 2017-01-26 13:39:41 +00:00
class-wp-rest-terms-controller.php REST API: Unify object access handling for simplicity. 2017-01-26 13:39:41 +00:00
class-wp-rest-users-controller.php REST API: Do not allow access to users from a different site in multisite. 2017-02-23 22:37:44 +00:00