block_version() – Returns the current version of the block format that the content string is using.

You appear to be a bot. Output may be restricted

Description

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

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

Usage

$int = block_version( $content );

Parameters

$content
( string ) required – Content to test.

Returns

int The block format version is 1 if the content contains one or more blocks, 0 otherwise.

Source

File name: wordpress/wp-includes/blocks.php
Lines:

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

 View on GitHub View on Trac