Introduces `WP_Connector_Registry` class and a `wp_connectors_init` action hook so plugins can register their own connectors alongside the built-in defaults (Anthropic, Google, OpenAI). Key changes: * `WP_Connector_Registry` — A `final` singleton class managing connector registration and lookup, with validation for IDs, required fields, and authentication methods. * `wp_connectors_init` action — Fired during `init` after built-in connectors are registered. Passes the registry instance so plugins call `$registry->register()` directly. * `_wp_connectors_init()` — Private function that creates the registry, merges hardcoded defaults with AI Client registry data, registers them, then fires the action. * Public read-only functions — `wp_is_connector_registered()`, `wp_get_connector()`, `wp_get_connectors()` for querying the registry after initialization. * Logo URL support — Connectors can include an optional `logo_url` field resolved from plugin directories via `_wp_connectors_resolve_ai_provider_logo_url()`. * Timing guards — `set_instance()` rejects calls after `init` completes. Registration is only possible during `wp_connectors_init`. * Connector API key settings are now only registered when the provider exists in the AI Client registry. * Refactors `_wp_connectors_get_connector_settings()` to read from the registry via `wp_get_connectors()`. Developed in https://github.com/WordPress/wordpress-develop/pull/11175 Props gziolo, flixos90, mukesh27, westonruter. Fixes #64791. Built from https://develop.svn.wordpress.org/trunk@61943 git-svn-id: http://core.svn.wordpress.org/trunk@61225 1a063a9b-81f0-0310-95a4-ce76da25c4cd
58 lines
1.1 KiB
PHP
58 lines
1.1 KiB
PHP
<?php
|
|
/**
|
|
* WordPress Version
|
|
*
|
|
* Contains version information for the current WordPress release.
|
|
*
|
|
* @package WordPress
|
|
* @since 1.2.0
|
|
*/
|
|
|
|
/**
|
|
* The WordPress version string.
|
|
*
|
|
* Holds the current version number for WordPress core. Used to bust caches
|
|
* and to enable development mode for scripts when running from the /src directory.
|
|
*
|
|
* @global string $wp_version
|
|
*/
|
|
$wp_version = '7.0-beta4-61943';
|
|
|
|
/**
|
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
|
*
|
|
* @global int $wp_db_version
|
|
*/
|
|
$wp_db_version = 61833;
|
|
|
|
/**
|
|
* Holds the TinyMCE version.
|
|
*
|
|
* @global string $tinymce_version
|
|
*/
|
|
$tinymce_version = '49110-20250317';
|
|
|
|
/**
|
|
* Holds the minimum required PHP version.
|
|
*
|
|
* @global string $required_php_version
|
|
*/
|
|
$required_php_version = '7.4';
|
|
|
|
/**
|
|
* Holds the names of required PHP extensions.
|
|
*
|
|
* @global string[] $required_php_extensions
|
|
*/
|
|
$required_php_extensions = array(
|
|
'json',
|
|
'hash',
|
|
);
|
|
|
|
/**
|
|
* Holds the minimum required MySQL version.
|
|
*
|
|
* @global string $required_mysql_version
|
|
*/
|
|
$required_mysql_version = '5.5.5';
|