If your plugin or theme uses custom post meta fields then you may want to store revisions to these fields when a post revision is saved. It’s easy to do.
For each of our meta fields, we’ll need to do three things:
- Store a revision of the meta field when a post is saved
- Revert to the correct revision of the meta field when a post is reverted
- Optionally, display the meta field on the revisions screen