Gutenberg: How filter blocks of a certain type with parse_blocks recursively?
parse_blocks() simply returns all blocks found in the post content, so for what you’re trying to get, you could use a function which calls itself recursively like so: function my_find_heading_blocks( $blocks ) { $list = array(); foreach ( $blocks as $block ) { if ( ‘core/heading’ === $block[‘blockName’] ) { // add current item, if … Read more