| [ Index ] |
PHP Cross Reference of WordPress Trunk (Updated Daily) |
[Source view] [Print] [Project Stats]
Connectors API: WP_Connector_Registry class.
| File Size: | 442 lines (15 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` or `application_password` authentication, a `setting_name` can be provided explicitly. When omitted, setting names are automatically generated using the pattern `connectors_{$type}_{$id}_{$method}`, with hyphens in the type and ID normalized to underscores. These setting names are used for 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. param: string $id The unique connector identifier. Must match the pattern param: array $args { return: array|null The registered connector data on success, null on failure. |
| 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. param: string $id The connector identifier. return: array|null The unregistered connector data on success, null on failure. |
| 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. param: string $id The connector identifier. return: bool True if the connector is registered, false otherwise. |
| 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. param: string $id The connector identifier. return: array|null The registered connector data, or null if it is not registered. |
| 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 : Fri Jul 24 08:20:19 2026 | Cross-referenced by PHPXref |