I;m trying to generated an ID saved with each individual Block of a specific type, I;m using the example given in the documentation but no joy, any ideas?
function generate_unique_block_id_for_acf_waveform_block( $attributes ) {
if ( isset($attributes['blockName']) && $attributes['blockName'] === 'acf/waveform' ) {
if ( empty( $attributes['anchor'] ) ) {
$attributes['anchor'] = uniqid();
}
}
return $attributes;
}
add_filter( 'acf/pre_save_block', 'generate_unique_block_id_for_acf_waveform_block', 10, 1 );