[wp-trac] [WordPress Trac] #39953: REST API: Add `date_floating` flag for posts

WordPress Trac noreply at wordpress.org
Fri Aug 3 04:25:43 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):

 > leave it as-is. It's up to REST API clients to keep track of whether the
 draft was scheduled or unscheduled.

 This is not going to work, because of the case you mentioned: different
 clients editing the same post.

 > when requesting a post in the "edit" context, don't do the magic from
 #38883 ... [but] it's a bit strange having `date_gmt`'s value be dependent
 on the request context.

 Let's not do this either.  Inconsistency bad.  :)

 > add a new field, called something like `date_floating`

 This is still my preferred solution.  I also haven't heard a name I like
 more than `date_floating`.

 > The downside to this is it's a bit messy deciding what to do when a
 draft is submitted with a `date_gmt` AND `date_float=true`, because
 `date_floating=true` means we should totally ignore whatever is submitted
 for `date_gmt`.

 I think this should be a `400 Bad Request` because the client is providing
 inconsistent information regarding what it wants the API to do.  Again:
 inconsistency = bad.

 > It feels like we're putting more paint over a crack in the foundation-
 it won't ever be pretty.

 No argument here.  Still, I think trying to fix this across all of WP
 would be very difficult and would cause a surprising amount of breakage.

 > Both add a bit of complexity to understanding the REST API, but provide
 the needed feature.

 This little flag is complexity of the ''application'', which should be
 reflected in the API.  It is a separate piece of information from the
 draft's date, so the simplest way for consumers of the API to understand
 this new feature is to use a separate field.

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


More information about the wp-trac mailing list