I'm using an custom theme and I would like to take the id to the values of a reusable block. I have this code:
<?php
$post = get_post();
if ( has_blocks( $post->post_content ) ) {
$blocks = parse_blocks( get_the_content() );
foreach($blocks as $block) {
$id= isset($block['attrs']['id']) ? $block['attrs']['id'] : '';
echo $id;
}
}
I see the id of all blocks but not reusable blocks. how do I access reusable block data?