WP_Connector_Registry::get_registeredpublicWP 7.0.0

Retrieves a registered connector.

Do not use this method directly. Instead, use the wp_get_connector()

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

Method of the class: WP_Connector_Registry{}

No Hooks.

Returns

Array|null. The registered connector data, or null if it is not registered.

Usage

$WP_Connector_Registry = new WP_Connector_Registry();
$WP_Connector_Registry->get_registered( $id ): ?array;
$id(string) (required)
The connector identifier.

Notes

Changelog

Since 7.0.0 Introduced.

WP_Connector_Registry::get_registered() code WP 7.0

public function get_registered( 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;
	}
	return $this->registered_connectors[ $id ];
}