has_blocks()
has_blocks( int|string|WP_Post|null $post = null )
确定post或content字符串是否有块。
Determine whether a post or content string has blocks.
说明(Description)
另见函数 parse_blocks()
参数(Parameters)
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
$post | (int | string | WP_Post | null) | 可选 | Post内容、Post ID或Post对象。默认为全局$post。 |
返回(Return)
(bool)帖子是否有块。
源码(Source)
更新版本 | 源码位置 | 使用 | 被使用 |
---|---|---|---|
5.0.0 | wp-includes/blocks.php:56 | 4 | 1 function |
has_blocks() 为WP2原创文章,链接:https://www.wp2.cn/functions/has_blocks/