Uma área de pesquisa sobre o WordPress para devs e autores do tema



block_version ›

Desde5.0.0
Obsoleton/a
block_version ( $content )
Parâmetros:
  • (string) $content Content to test.
    Required: Yes
Retorna:
  • (int) The block format version is 1 if the content contains one or more blocks, 0 otherwise.
Definido em:
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.



Fonte

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