#266 closed enhancement (fixed)
Enable collection pagination
| Reported by: | rmccue | Owned by: | rmccue |
|---|---|---|---|
| Priority: | major | Milestone: | 2013 Midterm (Beta) |
| Component: | JSON REST API | Keywords: | |
| Cc: | prettyboymp |
Description
Tracking ticket for week 4.
Change History (9)
#6
follow-up:
↓ 7
@
13 years ago
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.
#7
in reply to: ↑ 6
@
13 years ago
Replying to 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.)
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
In 2083: