Go to file
Sergey Biryukov 9afe01b087 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.

git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40115 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-24 22:02:48 +00:00
src REST API: Shim `post_date_gmt` for drafts / empty dates in the REST API. 2017-02-24 22:02:48 +00:00
tests REST API: Shim `post_date_gmt` for drafts / empty dates in the REST API. 2017-02-24 22:02:48 +00:00
tools/i18n DOCS: Replace HTTP links with HTTPS. 2016-06-10 04:49:09 +00:00
.editorconfig
.gitignore Revert [38401] after [38480]. 2016-09-06 18:12:09 +00:00
.jshintrc
.travis.yml Build/Test Tools: Remove PHP 7.1 from allowed failures 2016-12-02 06:43:46 +00:00
Gruntfile.js Build/Test tools: Add "apply" as alias for "patch" 2016-11-10 03:21:39 +00:00
npm-shrinkwrap.json Build: Remove fsevents from npm-shrinkwrap.json 2016-11-29 04:02:23 +00:00
package.json Post-4.7.2 version bump for 4.7 branch. 2017-01-26 21:57:54 +00:00
phpunit.xml.dist oEmbed: Remove the oEmbed provider unit tests. 2016-10-20 09:15:10 +00:00
wp-cli.yml
wp-config-sample.php
wp-tests-config-sample.php Tests: Use a minimal theme for tests. 2016-10-21 11:02:37 +00:00