首页 WordPress函数大全 has_blocks()

has_blocks()

2020-05-02 / 2499阅 / 悠然

如何你看完本文还不知道如何使用该函数,可以联系我定制视频教程,50元/个函数,学不会全额退款

has_blocks( int|string|WP_Post|null $post = null )

Determine whether a post or content string has blocks.

描述

This test optimizes for performance rather than strict accuracy, detecting the pattern of a block but not validating its structure. For strict accuracy, you should use the block parser id="see-also" tabindex="-1">See also See also

  • parse_blocks()

Top ↑

参数

$post

(int|string|WP_Post|null)
(Optional)
Post content, post ID, or post object. Defaults to global $post.

Default value: null

返回

(bool) Whether the post has blocks.

大家谈论
    我的见解