wpseek.com
Un motore di ricerca WordPress per sviluppatori e autori di temi



_excerpt_render_inner_blocks › WordPress Function

Da5.8.0
Deprecaton/a
_excerpt_render_inner_blocks ( $parsed_block, $allowed_blocks )
Accedi:
  • private
Parametri: (2)
  • (array) $parsed_block The parsed block.
    Richiesto:
  • (array) $allowed_blocks The list of allowed inner blocks.
    Richiesto:
Ritorna:
  • (string) The rendered inner blocks.
Definito a:
Codex:

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



Sorgenti

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;
}