wpseek.com
A WordPress-centric search engine for devs and theme authors



_excerpt_render_inner_blocks › WordPress Function

Since5.8.0
Deprecatedn/a
_excerpt_render_inner_blocks ( $parsed_block, $allowed_blocks )
Access:
  • private
Parameters: (2)
  • (array) $parsed_block The parsed block.
    Required: Yes
  • (array) $allowed_blocks The list of allowed inner blocks.
    Required: Yes
Returns:
  • (string) The rendered inner blocks.
Defined at:
Codex:

Render inner blocks from the allowed wrapper blocks for generating an excerpt.



Source

function _excerpt_render_inner_blocks( $parsed_block, $allowed_blocks ) {
	$output = '';

	foreach ( $parsed_block['innerBlocks'] as $inner_block ) {
		if ( ! in_array( $inner_block['blockName'], $allowed_blocks, true ) ) {
			continue;
		}

		if ( empty( $inner_block['innerBlocks'] ) ) {
			$output .= render_block( $inner_block );
		} else {
			$output .= _excerpt_render_inner_blocks( $inner_block, $allowed_blocks );
		}
	}

	return $output;
}