The block id is saved in the clientId field. It’s regenerated at each save of the post and is only available in props in the edit function. In order to use this field as unique id in the save function, it needs to be saved as attribute in the edit section. It will be then available in the save function via props.attributes.
Related Posts:
- Where can I find the Gutenberg block icons?
- How to trigger JS in gutenberg page load
- Gutenberg: Block validation failed
- Gutenberg extend core blocks
- Change order/position of Gutenberg inspector control panel
- What version of Gutenberg is included with WordPress?
- Add Formatting Buttons to Gutenberg core/paragraph BlockControls
- All post types with getEntityRecords
- How to disallow a certain custom gutenberg block outside of an InnerBlocks block?
- Why is onChange={ ( content ) => setAttributes( { content } )} now used?
- Gutenberg withInstanceId. When to use it?
- Gutenberg: How to Change Post Status Programmatically?
- Wrapping Gutenberg Blocks with a div/section/article
- How to access parent block’s attributes in nested block’s save function?
- Gutenberg Default attributes are empty
- Group block without inner wrapper
- Gutenberg InnerBlocks predefined block supports
- How to stop Gutenberg injecting inline font styles
- How to get Gutenberg Gallery Block to output thumbnail images?
- Change list of allowed headline levels in Gutenberg
- srcset attribute in Gutenberg gallery blocks
- How can I add arbitrary `data-` attributes to a block’s `edit()` container?
- Gutenburg InnerBlock single child
- WordPress-gutenberg – Block validation: Expected text
- Does `viewScript` in `block.json` actually enqueue a js file?
- 404 in gutenberg autosave of a Custom Post Type with custom rest_namespace
- Notices in the Block Editor with multiple lines
- Replication of core column block produces different markup
- How to change the Default block in the block-editor away from the paragraph block?
- Create RangeControl in gutenberg Block
- Where are the layout defaults in Twenty Twenty Two coming from?
- How to Disable auto id attributes in Heading tag?
- Gutenberg: how to hide server side render output in the editor but keep it in frontend?
- How to Get a List of Formats of a Block?
- Remove a plugin from the Gutenberg sidebar
- Gutenberg how to save to post meta?
- How to get current post id in Gutenberg Block save function?
- Gutenberg: dynamic block ToggleControl error in saving
- wp_schedule_single_event issue with save_post hook in gutenberg
- How to limit the selection of the first level block in Gutenberg editor
- disable gutemberg welcome message
- props.setAttributes results in “Maximum update depth exceeded.”
- How can I programmatically select a Gutenberg block?
- Clipboard processing in Gutenburg
- Gutenberg extending the existing class
- Gutenberg: Dynamic rendering of RichText
- Block Controls not showing
- Gutenberg and FSE: How to exclude a block from full site editing
- Disable only one Gutenberg block programatically / coblock/maps not listed in blocks
- How to select block variation from BlockVariationPicker
- WordPress Full Site Editing: How can I access my posts listing page?
- Wp-script package stop to work
- Editable button with RichText for Gutenberg custom block
- How Do I Prevent An Image From Automatically Adjusting In Guttenberg Block Gallery?
- How to reload data stored for a sever side gutenberg block in the editor
- Using wp_set_script_translations without manually registering the script
- How to remove the old “Custom CSS” from customizer after the theme has been migrated to Gutenberg FSE
- Why am I getting the error: Cannot update a component (`Unknown`) while rendering a different component (`Edit`)?
- Update number of posts when attribute changed
- Connect WordPress and react front-end
- Gutenberg editor auto remove wrapping tags like
- Setting fontSize within core/heading
- Unable to edit server side rendered block
- WordPress Dynamic Block with multiple checkboxes
- Embedded block editor in block editor
- useSelect in block Edit always returns default store value
- Count Gutenberg blocks on the front-end?
- How to call a react hook on edit of registerBlockType?
- Why does the paragraph block automatically add class?
- How can I block embeds and show an individual preview image per block?
- add arrow icon next to read more link on latest posts gutenberg block
- Create a trailing block with programatically generated Gutenberg columns
- How to make attributes unique to Gutenberg blocks
- How to check title is being entered in Title Case?
- Gutenberg link of internal page not showing
- How do I trigger the sidebar reveal for my sidebar plugin in the Gutenberg editor?
- Create Gutenburg Block to render inline SVG
- Gutenberg blocks not full width
- How to extend the URLPopover render settings for the paragraph Gutenberg block?
- Custom Image Gutenberg Block With Caption
- How to make a block similar to another block
- Component toggle not toggling
- Disabling gutenbeg slow down post saving
- Gutenberg: How to enqueue scripts conditionally in render_callback by checking for an attribute?
- How can I reintroduce autocompletion of Gutenberg components in Visual Code?
- Blocks – any way to have editor honor width percentages on child blocks?
- Using `esc_attr( get_block_wrapper_attributes() )`, results in `class=””wp-block-foo””`
- Change Featured image location from side to normal using react (gutenberg)
- How to condition appearance of a gutenberg block via wp_is_mobile
- Can I strip WordPress classes from blocks?
- Get postId in a wordpress pattern file?
- Remove placeholder from core/image in InnerBlocks template
- Gutenberg block not displaying prop values
- ACF InnerBlocks breaks css grid, How can we add classes to allowedblocks (WordPress Gutenberg)
- How to disable block directory?
- Adding custom link text to a URLInputButton
- Rearrange order of block into a block category gutenberg
- Gutenberg Block Deprecation – Handling old viewScript and styles
- Resaving posts to update static blocks
- How to dynamically add style tags to Gutenberg editor in react