wp_is_connector_registered()
Checks whether a connector with the specified identifier is registered.
No Hooks.
Returns
true|false.
true- the connector is registered.false- the connector is not registered or the registry is unavailable.
Usage
wp_is_connector_registered( $id ): bool;
- $id(string) (required)
- Connector identifier, for example
anthropic.
Examples
#1 Connector check before retrieval
if ( ! wp_is_connector_registered( 'anthropic' ) ) {
return;
}
$connector = wp_get_connector( 'anthropic' );
Notes
Changelog
| Since 7.0.0 | Introduced. |
wp_is_connector_registered() wp is connector registered code WP 7.0.4
function wp_is_connector_registered( string $id ): bool {
$registry = WP_Connector_Registry::get_instance();
if ( null === $registry ) {
return false;
}
return $registry->is_registered( $id );
}