WordPress\AiClient\Providers
ProviderRegistry::isProviderConfigured
Checks if a provider is properly configured.
Method of the class: ProviderRegistry{}
No Hooks.
Returns
true|false. True if the provider is configured and ready to use.
Usage
$ProviderRegistry = new ProviderRegistry(); $ProviderRegistry->isProviderConfigured( $idOrClassName ): bool;
- $idOrClassName(string|class-string
) (required) - The provider ID or class name.
Changelog
| Since 0.1.0 | Introduced. |
ProviderRegistry::isProviderConfigured() ProviderRegistry::isProviderConfigured code WP 7.0
public function isProviderConfigured(string $idOrClassName): bool
{
try {
$className = $this->resolveProviderClassName($idOrClassName);
// Use static method from ProviderInterface
/** @var class-string<ProviderInterface> $className */
$availability = $className::availability();
return $availability->isConfigured();
} catch (InvalidArgumentException $e) {
return \false;
}
}