WPDev.one
Core Function
View Source on Trac ↗

has_blocks()

has_blocks( mixed $post = null )

Determines whether a post or content string has blocks.

Parameters 1 required

Name / Type Description
mixed

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

Required

Return Value

(bool)
Whether the post has blocks.

Function Information

Since Version
5.0.0
Source File
wp-includes/blocks.php
Advertisement