Returns an array of the names of all registered dynamic block types.
Source
if ( ! str_contains( $block_name, '/' ) ) {
$block_name = 'core/' . $block_name;
}
// Test for existence of block by its fully qualified name.
$has_block = str_contains( $post, '<!-- wp:' . $block_name . ' ' );
if ( ! $has_block ) {
/*
* If the given block name would serialize to a different name, test for
* existence by the serialized form.
*/
Changelog
Version | Description |
---|---|
5.0.0 | Introduced. |
User Contributed Notes