[wp-trac] [WordPress Trac] #44321: REST API: Expose revision count and last revision ID on Post response

WordPress Trac noreply at wordpress.org
Thu Jun 7 11:56:42 UTC 2018


#44321: REST API: Expose revision count and last revision ID on Post response
-------------------------------------------------+-------------------------
 Reporter:  danielbachhuber                      |       Owner:  (none)
     Type:  enhancement                          |      Status:  new
 Priority:  normal                               |   Milestone:  4.9.8
Component:  REST API                             |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  needs-patch dev-feedback needs-      |     Focuses:
  unit-tests                                     |
-------------------------------------------------+-------------------------

Comment (by kadamwhite):

 Spoke to @rmccue about this a bit and here's my take: First, I would have
 expected that revision count would be handled similarly to comment count,
 as it's a similar type of question. Now, we don't seem to _expose_ comment
 count at all, sooo... maybe we should address that here, too :)

 I agree that this feels like a task for `_links`. Looking at
 [https://tools.ietf.org/html/rfc5988#section-3 the web linking RFC], it's
 spec-compliant to add new key/value pairs to a link object:

 > Target attributes are a set of key/value pairs that describe the link or
 its target; for example, a media type hint. This specification does not
 attempt to coordinate their names or use, but does provide common target
 attributes for use in the Link HTTP header.

 This means that `count: ##` would be appropriate for addition to both the
 `version-history` and `replies` properties.

 For `last_id`, we could also jam that into the _link for the version
 history relation; OR we could specify it as a new link. I'm slightly
 biased towards the latter but the former is certainly lighter weight.

 To validate an assumption: I haven't checked this, but I'm guessing the
 last revision ID refers to the parent revision of the published post, NOT
 a revision that is equal to the published post?

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


More information about the wp-trac mailing list