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

Retrieves a registered connector.

Description

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

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 registered connector data, or null if it is not registered.

Source

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 ];
}

Changelog

VersionDescription
7.0.0Introduced.

User Contributed Notes

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