GC_Block_Patterns_Registry::unregister()

最后更新于:2021-11-26 10:18:05

GC_Block_Patterns_Registry::unregister( string$pattern_name)

Unregisters a pattern.

参数

$pattern_name

(string) (Required) Pattern name including namespace.

响应

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

源文件

文件: gc-includes/class-gc-block-patterns-registry.php

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

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

		return true;
	}