block_version

Advertisement

Summery Summery

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

Syntax Syntax

block_version( string $content )

Description Description

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

Parameters Parameters

$content

(Required) Content to test.

Return Return

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

Source Source

File: wp-includes/blocks.php

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

Advertisement

Changelog Changelog

Changelog
Version Description
5.0.0 Introduced.

Advertisement

Leave a Reply