You are here

function plug_example_fruit_plugin_alter in Plug 7

Implements hook_fruit_plugin_alter().

Adds a new fruit plugin programmatically.

File

modules/plug_example/plug_example.module, line 44
Module implementation file.

Code

function plug_example_fruit_plugin_alter(&$plugins) {
  $plugin_manager = FruitPluginManager::create();
  $base_definition = array(
    'label' => 'Banana',
    'sugar' => 'medium',
    'id' => 'banana',
    'provider' => 'plug_example',
  );
  $plugin_manager
    ->processDefinition($base_definition);
  $plugins[$base_definition['id']] = $base_definition;
}