wpseek.com
WordPress开发者和主题制作者的搜索引擎
_excerpt_render_inner_blocks is private and should not be used in themes or plugins directly.
_excerpt_render_inner_blocks › WordPress Function
Since5.8.0
已弃用n/a
› _excerpt_render_inner_blocks ( $parsed_block, $allowed_blocks )
| 访问: |
|
| 参数: (2) |
|
| 返回: |
|
| 定义在: |
|
| 文档: |
Renders inner blocks from the allowed wrapper blocks for generating an excerpt.
源码
function _excerpt_render_inner_blocks( $parsed_block, $allowed_blocks ) {
$output = '';
foreach ( $parsed_block['innerBlocks'] as $inner_block ) {
// Hide the block whenever the value is boolean false, regardless of the
// block's current visibility support. This prevents blocks that previously
// supported visibility from unintentionally appearing on the front end
// after their support was disabled.
if ( false === ( $inner_block['attrs']['metadata']['blockVisibility'] ?? null ) ) {
continue;
}
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;
}