How do I implement Ctools plugins from other modules? I have a module which defines a plugin. Using this code, I can easily load the plugin:

ctools_include('plugins');
ctools_get_plugins('mymodule','myplugin');


That works great, but I would like my module to use plugins from other modules of type 'myplugin'.

I can only seem to get it to load plugins defined by the module provided in the first argument whereas I want to get all modules that provide plugin "myplugin", is there any way to do this?
With the code you shown, you get all the plugins of that type implemented by any module, not just from one module. In fact, when I execute the following code, I get the plugins implemented also from the Views UI module.

ctools_include('plugins');
dpm(ctools_get_plugins('ctools', 'export_ui'));




The module name passed as first argument to ctools_get_plugins() is used to namespace the plugin type: There can be other modules that implement a "export_ui" plugin type, and that is the reason why the function requires the name of the module defining the plugin type.

See also the description given for hook_ctools_plugin_directory():


  This hook is used to inform the CTools plugin system about the location of a directory that should be searched for files containing plugins of a particular type. CTools invokes this same hook for all plugins, using the two passed parameters to indicate the specific type of plugin for which it is searching.