Unregisters a block type.
Parameters
$name
string|WP_Block_Typerequired- Block type name including namespace, or alternatively a complete WP_Block_Type instance.
Source
public function unregister( $name ) {
if ( $name instanceof WP_Block_Type ) {
$name = $name->name;
}
if ( ! $this->is_registered( $name ) ) {
_doing_it_wrong(
__METHOD__,
/* translators: %s: Block name. */
sprintf( __( 'Block type "%s" is not registered.' ), $name ),
'5.0.0'
);
return false;
}
$unregistered_block_type = $this->registered_block_types[ $name ];
unset( $this->registered_block_types[ $name ] );
return $unregistered_block_type;
}
Changelog
Version | Description |
---|---|
5.0.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.