Skip to content
This repository was archived by the owner on Sep 24, 2018. It is now read-only.

Conversation

@rachelbaker
Copy link
Member

Use the posts_per_page and paged values from $query_args instead of only from the shortened Request params when calculating the X-WP-TotalPages header as well as the prev and next link headers. This prevents incorrect headers when either the filter[posts_per_page] or filter[paged] request params are used, as well as hooks into the rest_post_query filter.

Fixes #1876

@rachelbaker
Copy link
Member Author

@WP-API/amigos #reviewmerge

@rachelbaker
Copy link
Member Author

Even though it looks like only the Posts endpoints use the filter param, the Users endpoint does include a filter (rest_user_query) so 5640d87 fixes the pagination headers there as well.

joehoyle added a commit that referenced this pull request Dec 21, 2015
Adjust Posts Pagination Headers for `filter` Params
@joehoyle joehoyle merged commit 993ad02 into develop Dec 21, 2015
@joehoyle joehoyle deleted the 1876-pagination-headers branch December 21, 2015 01:31
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants