Opened 5 years ago
Closed 5 years ago
#49187 closed defect (bug) (duplicate)
WordPress REST API incorrect pagination
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 4.7 |
Component: | REST API | Keywords: | |
Focuses: | Cc: |
Description
The header x-wp-total
value is inconsistent with the actual number of objects in the payload for some cases
See screenshot/attachment
ubuntu@wordpress:~$ python3 Python 3.6.8 (default, Oct 7 2019, 12:59:55) [GCC 8.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import json, requests >>> response = requests.get("http://WORDPRESS_IP/wp-json/wp/v2/media", params={"per_page": 100, "page": 1}) >>> int(response.headers.get("x-wp-total")) 67 >>> len(response.json()) 66
Change History (1)
Note: See
TracTickets for help on using
tickets.
Hi @akshayshah,
Thanks for the ticket and welcome to trac!
We are already tracking this issue in #42947.