取消注册块类型。
原型
unregister_block_type( string|WP_Block_Type $name )
参数
$name
(string|WP_Block_Type)
(Required)
块类型名称包括命名空间,或者是完整的WP_Block_Type实例。
返回值
(WP_Block_Type|false)
成功时未注册的块类型,或失败时为false。
源文件
路径:wp-includes/blocks.php
<?php
...
function unregister_block_type( $name ) {
return WP_Block_Type_Registry::get_instance()->unregister( $name );
}
...
?>
其他
英文文档:https://developer.wordpress.org/reference/functions/unregister_block_type/