Title: Preview Changes in REST API
Last modified: February 7, 2017

---

# Preview Changes in REST API

 *  Resolved [jvke](https://wordpress.org/support/users/jvke/)
 * (@jvke)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/preview-changes-in-rest-api/)
 * Hi all!
 * I’m having difficulty finding any documentation around the ‘Preview Changes’*
   functionality, and whether this is available in REST API without a lot of custom
   work.
 * * I’m talking about the ‘preview’ button, used for looking at your new/edited
   content before publishing it for public viewers to see.
 * Thanks for any assistance

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [Adam Silverstein](https://wordpress.org/support/users/adamsilverstein/)
 * (@adamsilverstein)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/preview-changes-in-rest-api/#post-8769846)
 * Hi [@jvke](https://wordpress.org/support/users/jvke/),
 * Are you talking about in the case where you are building a JavaScript based theme
   that pulls its data from the API? This will require some extra work.
 * WordPress stores the post data in a temporary ‘autosave’ revision when you click
   the preview button: you will need to alter or filter your endpoint return to 
   use the revision data instead of the post data to display the preview. You can
   do this by adding a custom route with for ‘{route}/preview’, which adds a query
   var. the data endpoint responds to this by grabbing the autosave with ‘wp_get_post_autosave’
   and returning the data from the revision.
 *  Thread Starter [jvke](https://wordpress.org/support/users/jvke/)
 * (@jvke)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/preview-changes-in-rest-api/#post-8783716)
 * Thanks a lot, that’s a great solution. Much appreciated.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Preview Changes in REST API’ is closed to new replies.

 * In: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
 * 2 replies
 * 2 participants
 * Last reply from: [jvke](https://wordpress.org/support/users/jvke/)
 * Last activity: [9 years, 4 months ago](https://wordpress.org/support/topic/preview-changes-in-rest-api/#post-8783716)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
