Would you add in your roadmap to save meta values as well?
As I explain in the previous reply, this doesn't work because you can add multiple instances same block. If one field in each blog has different values, then there's no way to decide which value will be save in the post meta.
Just a note: when you use these helper functions, don't forget to use the parameter $post_id. If you want to use other WordPress functions, remember to use it as well, or you'll get the wrong info when preview the block in the edit screen.
If one field in each blog has different values, then there’s no way to decide which value will be save in the post meta.
Anh, I understand your point, but the fact is that blocks are created by aware developers and Gutenberg itself gives the possibility of storing data in post meta. (For example, it is enough to allow one such block per post and potential confusion is over)
I think there are many use cases for this.
An instant example from me five minutes ago: I want to create a block including editable featured image and it would be great if this advice would work in MB Blocks: https://support.metabox.io/topic/adding-fields-to-featured-image-metabox/
I second this. If multiple is set to false then it could work in tandem with another flag like post_meta set to true so that the block can save to the db as the block's ID for the meta_key
Not totally sure if it is possible but saving to the db as post_meta and rendering on the frontend at the same time would be a game changer. I need blocks for page creating but still use pieces of data on archive pages or search result like phone numbers, emails, etc.
I'm not familiar with MB Block internals, but in pure Gutenberg there are just 2 steps: registering post meta in PHP and defining "source: 'meta', meta: 'meta_field_key'" in JS block declaration. I feel that it might be not a big leap in MB code.