Skip to content

Commit f2f2d83

Browse files
Connectors: Register Akismet as a default non-AI connector.
Adds Akismet to the default connector registry as a `spam_filtering` type, with plugin metadata pointing to `akismet/akismet.php` and API key authentication wired to the existing `wordpress_api_key` option / `WPCOM_API_KEY` constant. The `is_active` callback defaults to `__return_false` so the connector reports inactive until the Akismet plugin overrides it from its own registration.
1 parent d141ecb commit f2f2d83

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

src/wp-includes/connectors.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,27 @@ function _wp_connectors_init(): void {
210210
_wp_connectors_register_default_ai_providers( $registry );
211211
}
212212

213+
// Non-AI default connectors.
214+
$registry->register(
215+
'akismet',
216+
array(
217+
'name' => __( 'Akismet Anti-spam' ),
218+
'description' => __( 'Protect your site from spam.' ),
219+
'type' => 'spam_filtering',
220+
'plugin' => array(
221+
'file' => 'akismet/akismet.php',
222+
// If the plugin is active, it will pass its its own is_active callback.
223+
'is_active' => '__return_false',
224+
),
225+
'authentication' => array(
226+
'method' => 'api_key',
227+
'credentials_url' => 'https://akismet.com/get/',
228+
'setting_name' => 'wordpress_api_key',
229+
'constant_name' => 'WPCOM_API_KEY',
230+
),
231+
)
232+
);
233+
213234
/**
214235
* Fires when the connector registry is ready for plugins to register connectors.
215236
*

0 commit comments

Comments
 (0)