Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on Sep 24, 2018. It is now read-only.

Adjust Posts Pagination Headers for filter Params - #1878

#1878
Merged
joehoyle merged 5 commits into
developWP-API/WP-API:developfrom
1876-pagination-headersWP-API/WP-API:1876-pagination-headersCopy head branch name to clipboard
Dec 21, 2015
Merged

Adjust Posts Pagination Headers for filter Params#1878
joehoyle merged 5 commits into
developWP-API/WP-API:developfrom
1876-pagination-headersWP-API/WP-API:1876-pagination-headersCopy head branch name to clipboard

Conversation

@rachelbaker

Copy link
Copy Markdown
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
Copy Markdown
Member Author

@WP-API/amigos #reviewmerge

@rachelbaker

Copy link
Copy Markdown
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.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.