wpseek.com
A WordPress-centric search engine for devs and theme authors



block_version › WordPress Function

Since5.0.0
Deprecatedn/a
block_version ( $content )
Parameters:
  • (string) $content Content to test.
    Required: Yes
Returns:
  • (int) The block format version is 1 if the content contains one or more blocks, 0 otherwise.
Defined at:
Codex:

Returns the current version of the block format that the content string is using.

If the string doesn't contain blocks, it returns 0.


Source

function block_version( $content ) {
	return has_blocks( $content ) ? 1 : 0;
}