[wp-trac] [WordPress Trac] #44975: REST API support switching draft to unscheduled

WordPress Trac noreply at wordpress.org
Thu Oct 4 18:15:52 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:                   |     Focuses:
-----------------------------+------------------------------
Changes (by kadamwhite):

 * keywords:  close =>


Comment:

 Respectfully, adding a field for the sole purpose of changing one piece of
 UI state in client interfaces is tremendous overkill. To springboard off
 your argument, the way WP has worked for years to my mind has been to
 embrace contextual solutions to historical inconsistencies, not force
 additional data and properties into classes, databases or API responses to
 perpetuate those inconsistencies. The intent of the REST API is to provide
 a consistent facade layer over those historical inconsistencies, not to
 expose those inconsistencies to clients through strange new response
 properties.

 I do not regard this as perpetuating the mistakes of the past; I think we
 have already perpetuated those mistakes by returning a "false" date when a
 post is floating, rather than providing `null` in that instance. That's an
 inconsistency we can address with v3 of the REST API, but I hold the ship
 has sailed for v2, and my goal therefore is to ensure that things work as
 consistently and predictably as possible when consuming the existing data.

 I am in favor of this ticket, and believe the appropriate response to
 accept to restore floating date status would be `null`, as that has the
 most explicit meaning of "unset this" in other APIs. However
 @danielbachhuber has requested that we validate whether we accept `''` or
 `false` for unsetting values elsewhere in the API, to ensure internal
 consistency.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/44975#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list