wpseek.com
Outil de recherche WordPress pour les développeurs et auteurs de thèmes



block_version › WordPress Function

Depuis5.0.0
Dépréciéen/a
block_version ( $content )
Paramètres:
  • (string) $content Content to test.
    Requis: Oui
Retourne:
  • (int) The block format version is 1 if the content contains one or more blocks, 0 otherwise.
Défini(e) dans:
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.


Source

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