unregister_block_type

函数
unregister_block_type ( $name )
参数
  • (string|WP_Block_Type) $name Block type name including namespace, or alternatively a complete WP_Block_Type instance.
    Required:
返回值
  • (WP_Block_Type|false) The unregistered block type on success, or false on failure.
定义位置
相关方法
register_block_typeunregister_block_styleregister_block_styleunregister_post_typeregister_post_type
引入
5.0.0
弃用
-

unregister_block_type: 该函数取消对一个自定义块类型的注册。它需要一个参数,即$block_name,它是块的名称。

取消注册一个区块类型。

function unregister_block_type( $name ) {
	return WP_Block_Type_Registry::get_instance()->unregister( $name );
}

常见问题

FAQs
查看更多 >