_excerpt_render_inner_columns_blocks()
云策文档标注
概述
_excerpt_render_inner_columns_blocks() 是一个 WordPress 函数,用于从 core/columns 块渲染内部块以生成摘要。该函数已在 5.8.0 版本中被弃用,建议使用替代函数。
关键要点
- 函数用途:渲染 core/columns 块的内部块,用于生成摘要。
- 参数:$columns(必需,解析后的 columns 块数组)和 $allowed_blocks(必需,允许的内部块列表数组)。
- 返回值:返回渲染后的内部块字符串。
- 弃用状态:自 WordPress 5.8.0 起被弃用,应改用 _excerpt_render_inner_blocks() 函数。
- 相关函数:_excerpt_render_inner_blocks() 和 _deprecated_function()。
代码示例
function _excerpt_render_inner_columns_blocks( $columns, $allowed_blocks ) {
_deprecated_function( __FUNCTION__, '5.8.0', '_excerpt_render_inner_blocks()' );
return _excerpt_render_inner_blocks( $columns, $allowed_blocks );
}注意事项
- 此函数已弃用,新代码中应避免使用,以保持兼容性和最佳实践。
- 弃用信息会通过 _deprecated_function() 输出,提醒开发者迁移到新函数。
原文内容
Render inner blocks from the core/columns block for generating an excerpt.
Description
See also
Parameters
$columnsarrayrequired-
The parsed columns block.
$allowed_blocksarrayrequired-
The list of allowed inner blocks.
Source
function _excerpt_render_inner_columns_blocks( $columns, $allowed_blocks ) {
_deprecated_function( __FUNCTION__, '5.8.0', '_excerpt_render_inner_blocks()' );
return _excerpt_render_inner_blocks( $columns, $allowed_blocks );
}
Changelog
| Version | Description |
|---|---|
| 5.8.0 | Deprecated. Use _excerpt_render_inner_blocks() introduced in 5.8.0. |
| 5.2.0 | Introduced. |