Custom fields are not restored to previous revisions

I have built several WordPress websites and noticed that custom fields are not restored to previous revisions. This might cause a problem when using custom fields to store content. Anybody knows how to add the custom fields to the revision history?

Related posts

Leave a Reply

1 comment

  1. Post revisions are for the fields in the posts database table and not the postmeta database table.

    So if you want to create your own postmeta revision you could save the meta when the revision is made using _wp_put_post_revision and you can restore the meta using wp_restore_post_revision.