WP_Block_Pattern_Categories_Registry::unregister( string $category_name ): bool

In this article

Unregisters a pattern category.

Parameters

$category_namestringrequired
Pattern category name including namespace.

Return

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

Source

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

VersionDescription
5.5.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.