block_version( string $content )

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

Description Description

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

Top ↑

Parameters Parameters


(string) (Required) Content to test.

Top ↑

Return Return

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

Top ↑

Source Source

File: wp-includes/blocks.php

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

Top ↑

Changelog Changelog

Version Description
5.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.