Changeset 61983 for trunk/src/wp-includes/class-wp-connector-registry.php
- Timestamp:
- 03/12/2026 07:54:50 AM (7 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-connector-registry.php
r61943 r61983 17 17 * 18 18 * @phpstan-type Connector array{ 19 * name: string,20 * description: string,21 * logo_url?: string|null,22 * type: string,19 * name: non-empty-string, 20 * description: non-empty-string, 21 * logo_url?: non-empty-string, 22 * type: 'ai_provider', 23 23 * authentication: array{ 24 * method: string,25 * credentials_url?: string|null,26 * setting_name?: string24 * method: 'api_key'|'none', 25 * credentials_url?: non-empty-string, 26 * setting_name?: non-empty-string 27 27 * }, 28 28 * plugin?: array{ 29 * slug: string29 * slug: non-empty-string 30 30 * } 31 31 * } … … 63 63 * @type string $name Required. The connector's display name. 64 64 * @type string $description Optional. The connector's description. Default empty string. 65 * @type string |null $logo_url Optional. URL to the connector's logo image. Default null.65 * @type string $logo_url Optional. URL to the connector's logo image. 66 66 * @type string $type Required. The connector type. Currently, only 'ai_provider' is supported. 67 67 * @type array $authentication { 68 68 * Required. Authentication configuration. 69 69 * 70 * @type string $method Required. The authentication method: 'api_key' or 'none'.71 * @type string |null$credentials_url Optional. URL where users can obtain API credentials.70 * @type string $method Required. The authentication method: 'api_key' or 'none'. 71 * @type string $credentials_url Optional. URL where users can obtain API credentials. 72 72 * } 73 * @type array $plugin {73 * @type array $plugin { 74 74 * Optional. Plugin data for install/activate UI. 75 75 * … … 159 159 160 160 if ( 'api_key' === $args['authentication']['method'] ) { 161 $connector['authentication']['credentials_url'] = $args['authentication']['credentials_url'] ?? null; 162 $connector['authentication']['setting_name'] = "connectors_ai_{$id}_api_key"; 161 if ( ! empty( $args['authentication']['credentials_url'] ) && is_string( $args['authentication']['credentials_url'] ) ) { 162 $connector['authentication']['credentials_url'] = $args['authentication']['credentials_url']; 163 } 164 $connector['authentication']['setting_name'] = "connectors_ai_{$id}_api_key"; 163 165 } 164 166 … … 207 209 * @see wp_get_connectors() 208 210 * 209 * @return array<string, array> The array of registered connectors keyed by connector ID. 211 * @return array Connector settings keyed by connector ID. 212 * 210 213 * @phpstan-return array<string, Connector> 211 214 */
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)