do_action( 'wp_connectors_init', WP_Connector_Registry $registry )
- Since
- 7.0.0
Description
Built-in connectors and any AI providers auto-discovered from the WP AI Client registry have already been registered at this point and cannot be unhooked.
AI provider plugins that register with the WP AI Client do not need to use this action — their connectors are created automatically. This action is primarily for registering non-AI-provider connectors or overriding metadata on existing connectors.
Use $registry->register() within this action to add new connectors.
To override an existing connector, unregister it first, then re-register with updated data.
Example — overriding metadata on an auto-discovered connector:
add_action( 'wp_connectors_init', function ( WP_Connector_Registry $registry ) {
if ( $registry->is_registered( 'anthropic' ) ) {
$connector = $registry->unregister( 'anthropic' );
$connector['description'] = __( 'Custom description for Anthropic.', 'my-plugin' );
$registry->register( 'anthropic', $connector );
}
} );Compatibility
- WordPress
- since 7.0.0
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in 2 of the 5 tracked releases, added in 7.0.0.
Parameters
$registryWP_Connector_Registry- Connector registry instance.
Where this hook fires · 1
wp-includes/connectors.php:276_wp_connectors_init()
Source code
* } ); * * @since 7.0.0 * * @param WP_Connector_Registry $registry Connector registry instance. */ do_action( 'wp_connectors_init', $registry );} /** * Registers connectors for the built-in AI providers. * * @since 7.0.0Changelog
Introduced in 7.0.0. Unchanged from 7.0.4 through 7.1.0.
Signature, return type and hooks compared across 2 parsed releases.
About this page
- Parsed data
- Generated from the wordpress-develop 7.1.0 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
- Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.