Retrieves a registered connector.
Description
See also
Parameters
$idstringrequired- The connector identifier.
Return
array|null Connector data, or null if not registered.namestringThe connector’s display name.descriptionstringThe connector’s description.logo_urlstringOptional. URL to the connector’s logo image.typestringThe connector type, e.g.'ai_provider'.authenticationarrayAuthentication configuration. When method is ‘api_key’, includes credentials_url, setting_name, and optionally constant_name and env_var_name. When ‘none’, only method is present.methodstringThe authentication method:'api_key'or'none'.credentials_urlstringOptional. URL where users can obtain API credentials.setting_namestringOptional. The setting name for the API key.constant_namestringOptional. PHP constant name for the API key.env_var_namestringOptional. Environment variable name for the API key.
pluginarrayOptional. Plugin data for install/activate UI.filestringThe plugin’s main file path relative to the plugins directory (e.g.'my-plugin/my-plugin.php'or'hello.php').is_activecallableCallback to determine whether the plugin is active. Receives no arguments and must return bool.
Defaults to__return_true.
Source
function wp_get_connector( string $id ): ?array { $registry = WP_Connector_Registry::get_instance(); if ( null === $registry ) { return null; } return $registry->get_registered( $id ); }Related
Uses Description WP_Connector_Registry::get_instance() wp-includes/class-wp-connector-registry.phpRetrieves the main instance of the registry class.
Changelog
Version Description 7.0.0 Introduced.
User Contributed Notes
You must log in before being able to contribute a note or feedback.