Returns the current version of the block format that the content string is using.
If the string doesn’t contain blocks, it returns 0.
$contentstringrequired
function block_version( $content ) {
return has_blocks( $content ) ? 1 : 0;
}
| Version | Description |
|---|---|
| 5.0.0 | Introduced. |
© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/block_version