block_version

The timeline below displays how wordpress function block_version has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 5.0

/**
 * Returns the current version of the block format that the content string is using.
 *
 * If the string doesn't contain blocks, it returns 0.
 *
 * @since 5.0.0
 *
 * @param string $content Content to test.
 * @return int The block format version is 1 if the content contains one or more blocks, 0 otherwise.
 */
function block_version($content)
{
    return has_blocks($content) ? 1 : 0;
}