block_version

函式
block_version ( $content )
引數
  • (string) $content Content to test.
    Required:
返回值
  • (int) The block format version is 1 if the content contains one or more blocks, 0 otherwise.
定義位置
相關方法
wp_kses_versionwp_check_php_versionwp_check_mysql_versionwp_version_checkdo_blocks
引入
5.0.0
棄用
-

block_version: 這個函式返回WordPress塊編輯器的當前版本號。

返回內容字串正在使用的塊格式的當前版本。

如果該字串不包含塊,則返回0。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function block_version( $content ) {
return has_blocks( $content ) ? 1 : 0;
}
function block_version( $content ) { return has_blocks( $content ) ? 1 : 0; }
function block_version( $content ) {
	return has_blocks( $content ) ? 1 : 0;
}

常見問題

FAQs
檢視更多 >