WordPress at Your Fingertips
function is not described

WP_Block_Patterns_Registry::unregister() public WP 5.5.0

Unregisters a pattern.

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

No Hooks.

Return

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

Usage

$WP_Block_Patterns_Registry = new WP_Block_Patterns_Registry();
$WP_Block_Patterns_Registry->unregister( $pattern_name );
$pattern_name(string) (required)
Pattern name including namespace.

Changelog

Since 5.5.0 Introduced.

Code of WP_Block_Patterns_Registry::unregister() WP 5.7.2

<?php
public function unregister( $pattern_name ) {
	if ( ! $this->is_registered( $pattern_name ) ) {
		/* translators: %s: Pattern name. */
		$message = sprintf( __( 'Pattern "%s" not found.' ), $pattern_name );
		_doing_it_wrong( __METHOD__, $message, '5.5.0' );
		return false;
	}

	unset( $this->registered_patterns[ $pattern_name ] );

	return true;
}