返回内容字符串正在使用的块格式的当前版本。
原型
block_version( string $content )
描述
如果字符串不包含块,则返回0。
参数
$content
(string)
(Required)
要测试的内容。
返回值
(int)
如果内容包含一个或多个块,则块格式版本为1,否则为0。
源文件
路径:wp-includes/blocks.php
<?php
...
function block_version( $content ) {
return has_blocks( $content ) ? 1 : 0;
}
...
?>
其他
英文文档:https://developer.wordpress.org/reference/functions/block_version/