Skip to content
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

Description

@bilalshahid10

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.

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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