wpseek.com
Outil de recherche WordPress pour les développeurs et auteurs de thèmes
wp_connectors_init › Les Actions WordPress
Depuis7.0.0
Dépréciéen/a
› do_action( 'wp_connectors_init', $registry )
| Paramètres: |
|
| Défini(e) dans: |
|
| Codex: |
Fires when the connector registry is ready for plugins to register connectors.
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 ); } } );Fonctions en relation: _wp_connectors_init, wp_get_connectors, wp_get_connector, wp_is_connector_registered, _wp_connectors_mask_api_key, wp_widgets_init
Hooks en relation: options-connectors_init, wp_roles_init, options-connectors-wp-admin_init, widgets_init, customize_controls_init