[wp-trac] [WordPress Trac] #51478: Rest api /pages endpoint returning old version of page when _fields is present in the rest query
WordPress Trac
noreply at wordpress.org
Thu Oct 8 09:29:07 UTC 2020
#51478: Rest api /pages endpoint returning old version of page when _fields is
present in the rest query
--------------------------+-----------------------------
Reporter: roquec | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: REST API | Version: 5.5.1
Severity: normal | Keywords:
Focuses: rest-api |
--------------------------+-----------------------------
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
--
Ticket URL: <https://core.trac.wordpress.org/ticket/51478>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list