Support › MB Blocks › MB Block, assign unique id to a block when used more times on a page
Hi! How can i assign a unique id to a block when used more times on a page?
Each block has its own unique ID, please refer to this topic https://support.metabox.io/topic/block-doesnt-receive-unique-id-when-duplicated/
coud you post a simple example to get (in backend) block unique id using hook "enqueue_block_editor_assets"? (for example log it to console)
In documentation (https://docs.metabox.io/extensions/mb-blocks/) is mentioned to decode json string but not very clear about how to do it.
The plugin does not support passing the block ID when using hook enqueue_block_editor_assets to enqueue scripts/styles. You can use the block ID in the render callback or template. See more here https://docs.metabox.io/extensions/mb-blocks/#render_callback