excerpt_allowed_wrapper_blocks
云策文档标注
概述
excerpt_allowed_wrapper_blocks 是一个 WordPress 过滤器,用于控制哪些块可以作为包装块,以便从这些包装块的 innerBlocks 生成摘要。
关键要点
- 过滤器名称:excerpt_allowed_wrapper_blocks
- 参数:$allowed_wrapper_blocks,一个字符串数组,表示允许的包装块名称列表
- 用途:允许从包装块的 innerBlocks 生成摘要,影响 excerpt_remove_blocks() 函数的行为
- 引入版本:WordPress 5.8.0
代码示例
$allowed_wrapper_blocks = apply_filters( 'excerpt_allowed_wrapper_blocks', $allowed_wrapper_blocks );
原文内容
Filters the list of blocks that can be used as wrapper blocks, allowing excerpts to be generated from the innerBlocks of these wrappers.
Parameters
$allowed_wrapper_blocksstring[]-
The list of names of allowed wrapper blocks.
Source
$allowed_wrapper_blocks = apply_filters( 'excerpt_allowed_wrapper_blocks', $allowed_wrapper_blocks );
Changelog
| Version | Description |
|---|---|
| 5.8.0 | Introduced. |