wp_get_connectors(): array

Retrieves all registered connectors.

Description

See also

Return

array Connector settings keyed by connector ID.
  • ...$0 array
    Data for a single connector.
    • name string
      The connector’s display name.
    • description string
      The connector’s description.
    • logo_url string
      Optional. URL to the connector’s logo image.
    • type string
      The connector type, e.g. 'ai_provider'.
    • authentication array
      Authentication 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.
      • method string
        The authentication method: 'api_key' or 'none'.
      • credentials_url string
        Optional. URL where users can obtain API credentials.
      • setting_name string
        Optional. The setting name for the API key.
      • constant_name string
        Optional. PHP constant name for the API key.
      • env_var_name string
        Optional. Environment variable name for the API key.
    • plugin array
      Optional. Plugin data for install/activate UI.
      • file string
        The plugin’s main file path relative to the plugins directory (e.g. 'my-plugin/my-plugin.php' or 'hello.php').
      • is_active callable
        Callback to determine whether the plugin is active. Receives no arguments and must return bool.
        Defaults to __return_true.
        }

Source

function wp_get_connectors(): array {
	$registry = WP_Connector_Registry::get_instance();
	if ( null === $registry ) {
		return array();
	}

	return $registry->get_all_registered();
}

Changelog

VersionDescription
7.0.0Introduced.

User Contributed Notes

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