WordPress at Your Fingertips
function is not described

WP_Block_Pattern_Categories_Registry::unregister() public WP 5.5.0

Unregisters a pattern category.

{} It's a method of the class: WP_Block_Pattern_Categories_Registry{}

No Hooks.

Return

true|false. True if the pattern was unregistered with success and false otherwise.

Usage

$WP_Block_Pattern_Categories_Registry = new WP_Block_Pattern_Categories_Registry();
$WP_Block_Pattern_Categories_Registry->unregister( $category_name );
$category_name(string) (required)
Pattern category name including namespace.

Changelog

Since 5.5.0 Introduced.

Code of WP_Block_Pattern_Categories_Registry::unregister() WP 5.8

<?php
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 ] );

	return true;
}