Skip to content

Commit b3c8e11

Browse files
committed
Merge branch 'collaboration/single-table' of github.com:josephfusco/wordpress-develop into collaboration/single-table
2 parents c08b703 + 693c813 commit b3c8e11

3 files changed

Lines changed: 231 additions & 29 deletions

File tree

src/wp-admin/css/dashboard.css

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,7 @@
570570
}
571571

572572
.community-events ul {
573-
background-color: #f6f7f7;
573+
background-color: rgba(var(--wp-admin-theme-color--rgb),.08);
574574
padding-left: 0;
575575
padding-right: 0;
576576
padding-bottom: 0;
@@ -582,15 +582,15 @@
582582
color: #2c3338;
583583
}
584584
.community-events li:first-child {
585-
border-top: 1px solid #f0f0f1;
585+
border-top: 1px solid #e9e9ed;
586586
}
587587

588588
.community-events li ~ li {
589-
border-top: 1px solid #f0f0f1;
589+
border-top: 1px solid #e9e9ed;
590590
}
591591

592592
.community-events .activity-block.last {
593-
border-bottom: 1px solid #f0f0f1;
593+
border-bottom: 1px solid #e9e9ed;
594594
padding-top: 0;
595595
margin-top: -1px;
596596
}

src/wp-includes/class-wp-connector-registry.php

Lines changed: 46 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
<?php
22
/**
3-
* Connectors API
4-
*
5-
* Defines WP_Connector_Registry class.
3+
* Connectors API: WP_Connector_Registry class.
64
*
75
* @package WordPress
86
* @subpackage Connectors
@@ -12,9 +10,23 @@
1210
/**
1311
* Manages the registration and lookup of connectors.
1412
*
13+
* This is an internal class. Use the public API functions to interact with connectors:
14+
*
15+
* - `wp_is_connector_registered()` — check if a connector exists.
16+
* - `wp_get_connector()` — retrieve a single connector's data.
17+
* - `wp_get_connectors()` — retrieve all registered connectors.
18+
*
19+
* Plugins receive the registry instance via the `wp_connectors_init` action
20+
* to register or override connectors directly.
21+
*
1522
* @since 7.0.0
1623
* @access private
1724
*
25+
* @see wp_is_connector_registered()
26+
* @see wp_get_connector()
27+
* @see wp_get_connectors()
28+
* @see _wp_connectors_init()
29+
*
1830
* @phpstan-type Connector array{
1931
* name: non-empty-string,
2032
* description: non-empty-string,
@@ -53,10 +65,22 @@ final class WP_Connector_Registry {
5365
/**
5466
* Registers a new connector.
5567
*
68+
* Validates the provided arguments and stores the connector in the registry.
69+
* For connectors with `api_key` authentication, a `setting_name` is automatically
70+
* generated using the pattern `connectors_ai_{$id}_api_key` (e.g., connector ID
71+
* `openai` produces `connectors_ai_openai_api_key`). This setting name is used
72+
* for the Settings API registration and REST API exposure.
73+
*
74+
* Registering a connector with an ID that is already registered will trigger a
75+
* `_doing_it_wrong()` notice and return `null`. To override an existing connector,
76+
* call `unregister()` first.
77+
*
5678
* @since 7.0.0
5779
*
58-
* @param string $id The unique connector identifier. Must contain only lowercase
59-
* alphanumeric characters and underscores.
80+
* @see WP_Connector_Registry::unregister()
81+
*
82+
* @param string $id The unique connector identifier. Must match the pattern
83+
* `/^[a-z0-9_]+$/` (lowercase alphanumeric and underscores only).
6084
* @param array $args {
6185
* An associative array of arguments for the connector.
6286
*
@@ -175,8 +199,17 @@ public function register( string $id, array $args ): ?array {
175199
/**
176200
* Unregisters a connector.
177201
*
202+
* Returns the connector data on success, which can be modified and passed
203+
* back to `register()` to override a connector's metadata.
204+
*
205+
* Triggers a `_doing_it_wrong()` notice if the connector is not registered.
206+
* Use `is_registered()` to check first when the connector may not exist.
207+
*
178208
* @since 7.0.0
179209
*
210+
* @see WP_Connector_Registry::register()
211+
* @see WP_Connector_Registry::is_registered()
212+
*
180213
* @param string $id The connector identifier.
181214
* @return array|null The unregistered connector data on success, null on failure.
182215
*
@@ -237,6 +270,9 @@ public function is_registered( string $id ): bool {
237270
*
238271
* Do not use this method directly. Instead, use the `wp_get_connector()` function.
239272
*
273+
* Triggers a `_doing_it_wrong()` notice if the connector is not registered.
274+
* Use `is_registered()` to check first when the connector may not exist.
275+
*
240276
* @since 7.0.0
241277
*
242278
* @see wp_get_connector()
@@ -272,9 +308,14 @@ public static function get_instance(): ?self {
272308
/**
273309
* Sets the main instance of the registry class.
274310
*
311+
* Called by `_wp_connectors_init()` during the `init` action. Must not be
312+
* called outside of that context.
313+
*
275314
* @since 7.0.0
276315
* @access private
277316
*
317+
* @see _wp_connectors_init()
318+
*
278319
* @param WP_Connector_Registry $registry The registry instance.
279320
*/
280321
public static function set_instance( WP_Connector_Registry $registry ): void {

0 commit comments

Comments
 (0)