WP_Block_Pattern_Categories_Registry::unregister( string $category_name ): bool
Unregisters a pattern category.
Parameters
-
$category_name
string Required -
Pattern category name including namespace.
Return
bool True if the pattern was unregistered with success and false otherwise.
Source
File: wp-includes/class-wp-block-pattern-categories-registry.php
.
View all references
public function unregister( $category_name ) {
if ( ! $this->is_registered( $category_name ) ) {
_doing_it_wrong(
__METHOD__,
/* translators: %s: Block pattern name. */
sprintf( __( 'Block pattern category "%s" not found.' ), $category_name ),
'5.5.0'
);
return false;
}
unset( $this->registered_categories[ $category_name ] );
unset( $this->registered_categories_outside_init[ $category_name ] );
return true;
}
Changelog
Version | Description |
---|---|
5.5.0 | Introduced. |