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

WordPress Trac noreply at wordpress.org
Thu Feb 23 23:34:12 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 nerrad):

 Thanks for explaining things, I was aware of how things worked on the WP
 side of things but clarifying what prompted the proposal in this ticket
 helps.

 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.

 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.

 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?

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


More information about the wp-trac mailing list