[wp-gsoc] [Summer of Code] #266: Enable collection pagination

Summer of Code noreply at wordpress.org
Tue Aug 6 01:17:13 UTC 2013


#266: Enable collection pagination
---------------------------+----------------------------------
 Reporter:  rmccue         |       Owner:  rmccue
     Type:  enhancement    |      Status:  new
 Priority:  major          |   Milestone:  2013 Midterm (Beta)
Component:  JSON REST API  |  Resolution:
 Keywords:                 |
---------------------------+----------------------------------

Comment (by rmccue):

 Replying to [comment:6 bpetty]:
 > I see posts_per_page, and page, but I'm not currently seeing any value
 indication in the schema for total number of items in a paged collection.
 I know some REST APIs will include a "last" link header, leaving it open
 for some parsing and calculations to get the total number of items. I
 still would like to see a total count somewhere else not requiring extra
 URL parsing, but I'm not sure where the best place for this would be
 honestly.

 Ah, whoops! This should be in `query_navigation_headers()` with the
 next/previous links. Agreed on the "last" header. Most likely, an `X-WP-
 Total` header would be the best option for a proper count.

 (Just to head off any comments: While `X-` headers are deprecated for
 things likely to make it into standards, they're still fine to use for
 vendor-specific headers.)

--
Ticket URL: <https://gsoc.trac.wordpress.org/ticket/266#comment:7>
Summer of Code <https://gsoc.trac.wordpress.org>
My example project


More information about the wp-gsoc mailing list