| [ Index ] |
PHP Cross Reference of WordPress Trunk (Updated Daily) |
[Source view] [Print] [Project Stats]
Connectors API: WP_Connector_Registry class.
| File Size: | 431 lines (14 kb) |
| Included or required: | 0 times |
| Referenced: | 0 times |
| Includes or requires: | 0 files |
| register( string $id, array $args ) X-Ref |
| Registers a new connector. Validates the provided arguments and stores the connector in the registry. For connectors with `api_key` authentication, a `setting_name` can be provided explicitly. If omitted, one is automatically generated using the pattern `connectors_{$type}_{$id}_api_key`, with hyphens in the type and ID normalized to underscores (e.g., connector type `spam_filtering` with ID `my_plugin` produces `connectors_spam_filtering_my_plugin_api_key`). This setting name is used for the Settings API registration and REST API exposure. Registering a connector with an ID that is already registered will trigger a `_doing_it_wrong()` notice and return `null`. To override an existing connector, call `unregister()` first. return: array|null The registered connector data on success, null on failure. param: string $id The unique connector identifier. Must match the pattern param: array $args { |
| unregister( string $id ) X-Ref |
| Unregisters a connector. Returns the connector data on success, which can be modified and passed back to `register()` to override a connector's metadata. Triggers a `_doing_it_wrong()` notice if the connector is not registered. Use `is_registered()` to check first when the connector may not exist. return: array|null The unregistered connector data on success, null on failure. param: string $id The connector identifier. |
| get_all_registered() X-Ref |
| Retrieves the list of all registered connectors. Do not use this method directly. Instead, use the `wp_get_connectors()` function. return: array Connector settings keyed by connector ID. |
| is_registered( string $id ) X-Ref |
| Checks if a connector is registered. Do not use this method directly. Instead, use the `wp_is_connector_registered()` function. return: bool True if the connector is registered, false otherwise. param: string $id The connector identifier. |
| get_registered( string $id ) X-Ref |
| Retrieves a registered connector. Do not use this method directly. Instead, use the `wp_get_connector()` function. Triggers a `_doing_it_wrong()` notice if the connector is not registered. Use `is_registered()` to check first when the connector may not exist. return: array|null The registered connector data, or null if it is not registered. param: string $id The connector identifier. |
| get_instance() X-Ref |
| Retrieves the main instance of the registry class. return: WP_Connector_Registry|null The main registry instance, or null if not yet initialized. |
| set_instance( WP_Connector_Registry $registry ) X-Ref |
| Sets the main instance of the registry class. Called by `_wp_connectors_init()` during the `init` action. Must not be called outside of that context. param: WP_Connector_Registry $registry The registry instance. |
| Generated : Sat Jun 13 09:38:55 2026 | Cross-referenced by PHPXref |