Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

_excerpt_render_inner_blocks() WordPress Function

The _excerpt_render_inner_blocks() function is used to render the content of an excerpt, while also supporting inner blocks. This function is used internally by the Wordpress excerpt rendering system.

_excerpt_render_inner_blocks( array $parsed_block, array $allowed_blocks ) #

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


Parameters

$parsed_block

(array)(Required)The parsed block.

$allowed_blocks

(array)(Required)The list of allowed inner blocks.


Top ↑

Return

(string) The rendered inner blocks.


Top ↑

Source

File: wp-includes/blocks.php

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


Top ↑

Changelog

Changelog
VersionDescription
5.8.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.