Changeset 62288 for trunk/src/wp-includes/connectors.php
- Timestamp:
- 04/30/2026 12:16:22 PM (3 months ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/connectors.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/connectors.php
r62210 r62288 368 368 } 369 369 } 370 371 if ( ! isset( $args['plugin']['is_active'] ) ) { 372 $args['plugin']['is_active'] = static function () use ( $ai_registry, $id ): bool { 373 try { 374 return $ai_registry->hasProvider( $id ); 375 } catch ( Exception $e ) { 376 return false; 377 } 378 }; 379 } 380 370 381 $registry->register( $id, $args ); 371 382 } … … 639 650 $registry = AiClient::defaultRegistry(); 640 651 641 if ( ! function_exists( 'is_plugin_active' ) ) {642 require_once ABSPATH . 'wp-admin/includes/plugin.php';643 }644 645 652 $connectors = array(); 646 653 foreach ( wp_get_connectors() as $connector_id => $connector_data ) { … … 675 682 if ( ! empty( $connector_data['plugin']['file'] ) ) { 676 683 $file = $connector_data['plugin']['file']; 677 $is_ installed = file_exists( wp_normalize_path( WP_PLUGIN_DIR . '/' . $file ));678 $is_ activated = $is_installed && is_plugin_active( $file);684 $is_activated = (bool) call_user_func( $connector_data['plugin']['is_active'] ); 685 $is_installed = $is_activated || file_exists( wp_normalize_path( WP_PLUGIN_DIR . '/' . $file ) ); 679 686 680 687 $connector_out['plugin'] = array(
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)