wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren



wp_get_connector › WordPress Function

Seit7.0.0
Veraltetn/v
wp_get_connector ( $id )
Parameter:
  • (string) $id The connector identifier.
    Erforderlich: Ja
Siehe:
  • WP_Connector_Registry::get_registered()
Gibt zurück:
  • (array|null) {
    Connector data, or null if not registered.

    @type string $name The connector's display name.
    @type string $description The connector's description.
    @type string $logo_url Optional. URL to the connector's logo image.
    @type string $type The connector type, e.g. 'ai_provider'.
    @type array $authentication {
    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.

    @type string $method The authentication method: 'api_key' or 'none'.
    @type string $credentials_url Optional. URL where users can obtain API credentials.
    @type string $setting_name Optional. The setting name for the API key.
    @type string $constant_name Optional. PHP constant name for the API key.
    @type string $env_var_name Optional. Environment variable name for the API key.
    }
    @type array $plugin {
    Optional. Plugin data for install/activate UI.

    @type string $file The plugin's main file path relative to the plugins
    directory (e.g. 'my-plugin/my-plugin.php' or 'hello.php').
    @type callable $is_active Callback to determine whether the plugin is active. Receives no arguments and must return bool.
    Defaults to `__return_true`.
    }
    }
Definiert in:
Codex:

Retrieves a registered connector.



Quellcode

function wp_get_connector( string $id ): ?array {
	$registry = WP_Connector_Registry::get_instance();
	if ( null === $registry ) {
		return null;
	}

	return $registry->get_registered( $id );
}