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

WordPress Trac noreply at wordpress.org
Fri Feb 24 17:32:37 UTC 2017


#39953: REST API: Add `date_auto_update` field for posts
------------------------------------------+------------------------------
 Reporter:  jnylen0                       |       Owner:
     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):

 Replying to [comment:3 nerrad]:
 > After the explanation I'm still wary of the need for an flag for auto-
 updating (whatever its called) on the endpoint.  I believe we need to be
 careful about controlling behaviour of data properties based on some other
 flag in the package.  It's more predictable and sets expectations better I
 think if the behaviour of the endpoint is that whatever you have the date
 set at on that field during an update is what gets saved.

 This bundling of multiple pieces of information/functionality into a
 single field is the way WP currently behaves, and it's broken.  It should
 have been a separate field from the start.

 > Practically that means that its up to the consumer to save the current
 `post_date_gmt` value to the equivalent of "now" in the PUT call if they
 want that to be the publish date (when publishing) the post.

 This isn't going to work because it would break the default behavior where
 a post is dated when it is published.

 > The other concern with setting a flag for controlling this behaviour is
 whether this is something applicable only on the post endpoint, or if its
 something that would apply to any custom post type (pages? menus?) If its
 only on the "posts" endpoint, then that does changing the schema for a
 post_type request depending on what "type" it is matter?  If it's
 including it on every post_type response, is it a fair assumption that all
 post types will follow the same behaviour patterns as a post?

 This applies equally to every post type which has a concept of a draft
 (not `attachment`).

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


More information about the wp-trac mailing list