Hi there
I am trying to make the «Preview Changes» button working again in a WP-REST API Setup.
I use the plugin «ACF TO REST API» https://github.com/airesvsg/acf-to-rest-api.
I understand that pushing that button the post is saved in a new autosave version, accessible via the revisions of that post.
Unfortunately the plugin does not support adding acf fields to the revisions page of a post. For example accessing the revisions of post 51 wp/v2/pages/51/revisions/?_wpnonce=1706b13467
(I need the nonce to authenticate) I am getting results looking like this:
{
"author": 1,
"date": "2017-11-17T18:19:51",
"date_gmt": "2017-11-17T17:19:51",
"id": 461,
"modified": "2017-11-17T18:19:51",
"modified_gmt": "2017-11-17T17:19:51",
"parent": 51,
"slug": "51-autosave-v1",
"guid":
{
"rendered": "http://[DOMAIN]/51-autosave-v1/"
},
"title":
{
"rendered": "post title"
},
"content":
{
"rendered": "post content"
},
"excerpt":
{
"rendered": ""
},
"_links":
{
"parent": [
{
"href": "http://[DOMAIN]/api/wp/v2/pages/51"
}]
}
},
as you can see this is only WordPress core stuff. What I need is a route where I get the revisions of the post INCLUDING the acf fields.
But I don’t know how revisions are handled with the ACF Pro Plugin. How can I query them specifically? How do I have to set the arguments to get the ACF fields including their revisions.
I would be really glad to get some help. I am trying to solve this problem for quite a while now wihtout any success at all so far.
Cheers and thanks