WP_Connector_Registry::unregister( string $id ): array|null

Unregisters a connector.

Description

Returns the connector data on success, which can be modified and passed back to register() to override a connector’s metadata.

Triggers a _doing_it_wrong() notice if the connector is not registered.
Use is_registered() to check first when the connector may not exist.

See also

Parameters

$idstringrequired
The connector identifier.

Return

array|null The unregistered connector data on success, null on failure.

Source

public function unregister( string $id ): ?array {
	if ( ! $this->is_registered( $id ) ) {
		_doing_it_wrong(
			__METHOD__,
			/* translators: %s: Connector ID. */
			sprintf( __( 'Connector "%s" not found.' ), esc_html( $id ) ),
			'7.0.0'
		);
		return null;
	}

	$unregistered = $this->registered_connectors[ $id ];
	unset( $this->registered_connectors[ $id ] );

	return $unregistered;
}

Changelog

VersionDescription
7.0.0Introduced.

User Contributed Notes

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