[wp-trac] [WordPress Trac] #44975: REST API support switching draft to unscheduled
WordPress Trac
noreply at wordpress.org
Fri Sep 28 23:28:56 UTC 2018
#44975: REST API support switching draft to unscheduled
-----------------------------+------------------------------
Reporter: mnelson4 | Owner: (none)
Type: feature request | Status: new
Priority: normal | Milestone: Awaiting Review
Component: REST API | Version:
Severity: normal | Resolution:
Keywords: close | Focuses:
-----------------------------+------------------------------
Changes (by jnylen0):
* keywords: => close
Comment:
> Should they provide a post's date set to `null`, `false`, `''`, or maybe
even to the same value as modified?
No, the API and its clients should use a separate field for this purpose.
If you were writing a new piece of code today that manipulates various
date values, and also has a flag to control a specific date-related
behavior, independent of the actual values of the dates, would you **re-
use a special value of one of the date variables** to control this
independent and separate flag, or use **a different variable**?
The correct answer is **a different variable**. Except that in this case,
the decision made will end up affecting the design and implementation of
any project that uses the REST API.
[https://core.trac.wordpress.org/ticket/5698#comment:14 This same mistake
was made 10 years ago], but please don't let that confuse the issue, and
please don't perpetuate the mistake further. I suggest closing this
ticket as a duplicate of #39953.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/44975#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list