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.
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
| Version | Description |
|---|---|
| 7.0.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.