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.
This repository was archived by the owner on Sep 24, 2018. It is now read-only.

"filter[posts_per_page]" not affecting the "X-WP-TotalPages" response header #1876

Copy link
Copy link

Description

@bilalshahid10
Issue body actions

Hi there,

I'm using filter[posts_per_page] to retrieve a collection of posts for my application. The problem I'm facing is that the filter[posts_per_page] parameter is not updating the X-WP-TotalPages header as returned in the response by the server.

However, if I use per_page parameter in the request, it's updating the X-WP-TotalPages accordingly.

Consider the following request to the server:

$ GET /wp/v2/posts?filter[posts_per_page]=5

The headers returned are as follows:

X-WP-Total → 45
X-WP-TotalPages → 5

Now if I use the per_page parameter like the following:

$ GET /wp/v2/posts?per_page=5

The headers returned are like the following:

X-WP-Total → 45
X-WP-TotalPages → 9

It can be seen that the later one updated the X-WP-TotalPages header accordingly.

I think that the X-WP-TotalPages should be updated whenever a request is made via filter[posts_per_page] parameter.

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

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