W3cubDocs

/WordPress

WP_Block_Bindings_Registry::unregister( string $source_name ): WP_Block_Bindings_Source|false

Unregisters a block bindings source.

Parameters

$source_namestringrequired
Block bindings source name including namespace.

Return

WP_Block_Bindings_Source|false The unregistered block bindings source on success and false otherwise.

Source

public function unregister( string $source_name ) {
	if ( ! $this->is_registered( $source_name ) ) {
		_doing_it_wrong(
			__METHOD__,
			/* translators: %s: Block bindings source name. */
			sprintf( __( 'Block binding "%s" not found.' ), $source_name ),
			'6.5.0'
		);
		return false;
	}

	$unregistered_source = $this->sources[ $source_name ];
	unset( $this->sources[ $source_name ] );

	return $unregistered_source;
}

Changelog

Version Description
6.5.0 Introduced.

© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_block_bindings_registry/unregister