block_version() WP 5.0.0
Returns the current version of the block format that the content string is using.
If the string doesn't contain blocks, it returns 0.
Хуков нет.
Возвращает
Число
. The block format version is 1 if the content contains one or more blocks, 0 otherwise.
Использование
block_version( $content );
- $content(строка) (обязательный)
- Content to test.
Список изменений
С версии 5.0.0 | Введена. |
Код block_version() block version WP 5.7
function block_version( $content ) {
return has_blocks( $content ) ? 1 : 0;
}