WordPress开发者和主题制作者的搜索引擎



block_version ›

Since5.0.0
已弃用n/a
block_version ( $content )
参数:
  • (string) $content Content to test.
    Required: Yes
返回:
  • (int) The block format version is 1 if the content contains one or more blocks, 0 otherwise.
定义在:
文档:

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

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



源码

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