How do I manage custom meta in post revisions in the Block Editor era?
Note to admins: I have been trawling every possible resource for this but cannot find a good answer for modern WordPress, so please don’t mark this as a duplicate of (“insert some answer from 2012 here”). I have seen the article by John Blackbourn but it is from a completely different era of WordPress.
I am using a meta block to store custom meta against a custom post type as per the recommended WordPress modern approach in the developer guide. It works perfectly, but the meta block content is not stored with the revisions. And the developer guide says nothing about making the meta compatible with revisions (at least not in that article about meta boxes).
When I review the revisions in the Revisions UI, I can see the meta block raw JSON there delimiting the meta block, but there is no content.
I am just wondering if anyone knows what best practice for getting custom meta to be compatible with post revisions is now that the calls to update meta are done via REST?
And how can we see the changes to the meta in the revision screens?
Any help gladly received as I am finding it hard to get up-to-date information on the best way to do this.
Leave an answer