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/recalled with the revisions, ie. when I load up an older revision, the post meta from the post at that time is not recalled, only the HTML block content like paragraphs, images etc.
The developer guide says nothing about making the meta compatible with revisions (at least not in that article about meta boxes), so I imagine this needs to be done manually – but I can't see how.
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. It looks like this in the post revisions UI (the block is registered as
<!-- wp:cwf/event-meta /-->
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.