On this page
_excerpt_render_inner_blocks( array $parsed_block, array $allowed_blocks ): string
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.
Renders inner blocks from the allowed wrapper blocks for generating an excerpt.
Parameters
$parsed_blockarray Required-
The parsed block.
$allowed_blocksarray Required-
The list of allowed inner blocks.
Return
string The rendered inner blocks.
Source
File: wp-includes/blocks.php. View all references
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;
}
Related
Uses
| Uses | Description |
|---|---|
| _excerpt_render_inner_blocks() wp-includes/blocks.php | Renders inner blocks from the allowed wrapper blocks for generating an excerpt. |
| render_block() wp-includes/blocks.php | Renders a single block into a HTML string. |
Used By
| Used By | Description |
|---|---|
| _excerpt_render_inner_blocks() wp-includes/blocks.php | Renders inner blocks from the allowed wrapper blocks for generating an excerpt. |
| _excerpt_render_inner_columns_blocks() wp-includes/deprecated.php | Render inner blocks from the |
| excerpt_remove_blocks() wp-includes/blocks.php | Parses blocks out of a content string, and renders those appropriate for the excerpt. |
Changelog
| Version | Description |
|---|---|
| 5.8.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/_excerpt_render_inner_blocks