Opens in a new tab
A picture of Jeff Brigman
I CODE TODAY FOR
A BETTER TOMORROW

Glossary Term

has_blocks()

3 tags 1 category

has_blocks() — Determines 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 on post content.

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

Returns bool: Whether the post has blocks.

Term Connections

Explore related terms connected by shared tags, shared categories, and relationship phrases. This map loads only when it comes into view.

Loading term connections…