#51478 closed defect (bug) (invalid)
Rest api /pages endpoint returning old version of page when _fields is present in the rest query
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | REST API | Keywords: | |
Focuses: | Cc: |
Description
Hi,
when retrieving a page with the rest API I'm using the following rest request:
https://mysite/wp-json/wp/v2/pages?slug=slug-of-the-page&_fields=content,status,title,slug,id
In the response, in the rendered content field, the wrong revision of the page is inside (maybe the first revision?).
But when using the following rest request (the same but without filtering the fields):
https://mysite/wp-json/wp/v2/pages?slug=slug-of-the-page
Then the last revision (the expected one) of the page is returned.
Regards
Change History (3)
#2
@
3 years ago
- Resolution set to invalid
- Status changed from new to closed
Hi there,
thank you for your attention. I request apologies for opening this ticket because I have found that there is no problem in the core of WP.
As you correctly said, there was a plugin (Relevanssi) that was manipulating the search query somehow.
I'm sorry.
Thank you for your attention.
Hi @roquec,
Thanks for your ticket and welcome to trac! Have you verified this on a WordPress site with a stock WordPress Theme, no Plugins, and all forms of caching disabled?
It sounds like something is caching the response.