WP_Connector_Registry::register │ public │ WP 7.0.0
Registers a new connector.
Validates the provided arguments and stores the connector in the registry. For connectors with api_key or application_password authentication, a setting_name can be provided explicitly. When omitted, setting names are automatically generated using the pattern connectors_{$type}_{$id}_{$method}, with hyphens in the type and ID normalized to underscores. These setting names are used for Settings API registration and REST API exposure.
Registering a connector with an ID that is already registered will trigger a _doing_it_wrong() notice and return null. To override an existing connector, call unregister() first.
method(string)
Required. The authentication method: 'api_key', 'application_password', or 'none'.
credentials_url(string)
Optional. URL where users can obtain API credentials.
setting_name(string)
Optional. The setting name for the API key or application-password credentials. When omitted, auto-generated as connectors_{$type}_{$id}_api_key for API keys and connectors_{$type}_{$id}_application_password for application passwords. Must be a non-empty string when provided.
constant_name(string)
Optional. PHP constant name for the API key (e.g. 'ANTHROPIC_API_KEY') or for application-password credentials in username:password format. Only checked when provided.
env_var_name(string)
Optional. Environment variable name for the API key (e.g. 'ANTHROPIC_API_KEY') or for application-password credentials in username:password format. Only checked when provided.
plugin(array)
Optional. Plugin data for install/activate UI.
file(string)
Optional. The plugin's main file path relative to the plugins directory (e.g. 'my-plugin/my-plugin.php' or 'hello.php').
is_active(callable)
Optional callback to determine whether the plugin is active. Receives no arguments and must return bool. Default: __return_true