You are here

function trigger_example_action_info_alter in Examples for Developers 6

Implementation of hook_action_info_alter().

None of the built-in actions will be enabled for our hook by default. We need to implement hook_action_info_alter() so that we can enable a couple.

Related topics

File

trigger_example/trigger_example.module, line 126

Code

function trigger_example_action_info_alter(&$info) {
  if (isset($info['system_message_action']['hooks'])) {
    $info['system_message_action']['hooks']['trigger_example'] = array(
      'ping',
      'pong',
    );
  }
  if (isset($info['system_send_email_action']['hooks'])) {
    $info['system_send_email_action']['hooks']['trigger_example'] = array(
      'ping',
      'pong',
    );
  }
}