WordPress开发者和主题制作者的搜索引擎



_excerpt_render_inner_columns_blocks ›

Since5.2.0
已弃用n/a
_excerpt_render_inner_columns_blocks ( $columns, $allowed_blocks )
访问:
  • private
参数: (2)
  • (array) $columns The parsed columns block.
    Required: Yes
  • (array) $allowed_blocks The list of allowed inner blocks.
    Required: Yes
返回:
  • (string) The rendered inner blocks.
定义在:
文档:

Render inner blocks from the `core/columns` block for generating an excerpt.



源码

function _excerpt_render_inner_columns_blocks( $columns, $allowed_blocks ) {
	$output = '';

	foreach ( $columns['innerBlocks'] as $column ) {
		foreach ( $column['innerBlocks'] as $inner_block ) {
			if ( in_array( $inner_block['blockName'], $allowed_blocks, true ) && empty( $inner_block['innerBlocks'] ) ) {
				$output .= render_block( $inner_block );
			}
		}
	}

	return $output;
}