Hi all,
What I’m trying to do is getting post custom fields to auto-populate an ACF Gutenberg block added to the editor. I’ve managed to do some of that with this snippet and then fetching meta with the $post_id
.
// Get post ID in preview mode
if ( $is_preview ) {
$post_id = $_POST['post_id'];
}
This means the block is not immediately updated when the post meta is changed obviously, but nor is the preview refreshed when the post is saved (because it doesn’t refresh the page).
So I wonder if it’s possible at all to trigger a block refresh when a post custom field is updated, as it happens with ACF Gutenberg blocks.
I understand saving post meta directly from blocks as suggested in acf/issues/83 would cleverly solve this, but any pointers are welcome.
Thanks in advance!