admin管理员组

文章数量:1425805

Is there a way to query previews made to updates of already published Posts via the WP API? For example, I am making updates to a post that has already been published, I click the preview button, and it takes me a url similar to

/?preview_id=219&preview_nonce=ff84df100b&preview=true&_thumbnail_id=245

Is there a way access that content via the API?

I am working on a headless WP project and need a way display the preview in our custom front end. I can display posts that are in Draft status, as well as posts that have been published, by hitting the API. It is this last case of published posts that have additional updates that I cannot seem to figure out.

Any help is appreciated, thanks!

Is there a way to query previews made to updates of already published Posts via the WP API? For example, I am making updates to a post that has already been published, I click the preview button, and it takes me a url similar to

http://example/my-post/?preview_id=219&preview_nonce=ff84df100b&preview=true&_thumbnail_id=245

Is there a way access that content via the API?

I am working on a headless WP project and need a way display the preview in our custom front end. I can display posts that are in Draft status, as well as posts that have been published, by hitting the API. It is this last case of published posts that have additional updates that I cannot seem to figure out.

Any help is appreciated, thanks!

Share Improve this question asked Jun 14, 2019 at 23:10 Anton EmeryAnton Emery 431 silver badge4 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

Figured it out. There is a revisions endpoint that you can query that will return the latest autosaved update.

https://developer.wordpress/rest-api/reference/post-revisions/

本文标签: Query Post Preview Updates from the WP API