Make WordPress Core


Ignore:
Timestamp:
04/01/2026 02:56:47 PM (5 months ago)
Author:
jorgefilipecosta
Message:

Connectors: Replace plugin.slug with plugin.file in connector registration.

Use the plugin's main file path relative to the plugins directory
(e.g. akismet/akismet.php or hello.php) instead of the WordPress.org slug
to identify a connector's associated plugin.
This lets _wp_connectors_get_connector_script_module_data() check plugin
status with file_exists() and is_plugin_active() directly, removing the
get_plugins() slug-to-file mapping that was previously needed.

Props jorgefilipecosta, mukesh27, gziolo.
Fixes #65002.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/connectors/wpConnectorRegistry.php

    r62180 r62192  
    295295        public function test_register_includes_plugin_data() {
    296296                $args           = self::$default_args;
    297                 $args['plugin'] = array( 'slug' => 'my-plugin' );
     297                $args['plugin'] = array( 'file' => 'my-plugin/my-plugin.php' );
    298298
    299299                $result = $this->registry->register( 'with-plugin', $args );
    300300
    301301                $this->assertArrayHasKey( 'plugin', $result );
    302                 $this->assertSame( array( 'slug' => 'my-plugin' ), $result['plugin'] );
     302                $this->assertSame( array( 'file' => 'my-plugin/my-plugin.php' ), $result['plugin'] );
    303303        }
    304304
Note: See TracChangeset for help on using the changeset viewer.