[wp-trac] [WordPress Trac] #39953: REST API: Add `date_floating` flag for posts
WordPress Trac
noreply at wordpress.org
Fri Aug 3 16:20:21 UTC 2018
#39953: REST API: Add `date_floating` flag for posts
------------------------------------------+------------------------------
Reporter: jnylen0 | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: REST API | Version: 4.7
Severity: normal | Resolution:
Keywords: needs-patch needs-unit-tests | Focuses: rest-api
------------------------------------------+------------------------------
Comment (by jnylen0):
> In my opinion there should have been no dates stored for either
`post_date` or `post_date_gmt` until published or manually set, and
`post_modified` and `post_modified_gmt` should have been used instead.
Yep, this is getting closer to what the ideal design could have been from
the beginning.
There are really several separate dates in play here, which may or may not
be equal in various circumstances.
- **Published/updated date** - `post_date` and `post_date_gmt`. Usually.
- **Modified date** - always read-only, unless you try really hard and
edit this via a direct db query.
- **Creation date** - currently `post_date` serves this role for drafts...
until the draft is published, then the creation date may be lost, and
`post_date` and `post_date_gmt` suddenly mean "date published".
Complicated for sure. I guess we could do some kind of hack to add
`created` and `created_gmt`, but it would be even more complicated, and
the field values would often be inconsistent or missing since there just
isn't a natural way to separate and store these separate pieces of
information.
> The only way I see out of this while maintaining full back-compat is
some kind of flag.
+1
--
Ticket URL: <https://core.trac.wordpress.org/ticket/39953#comment:15>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list