hook_hook_info()
contributions/docs/developer/hooks/core.php, line 300
Expose a list of triggers (events) that your module is allowing users to assign actions to.
This hook is used by the Triggers API to present information about triggers (or events) that your module allows users to assign actions to.
See also hook_action_info().
For example, the node_hook_info implementation has 'node' as the outermost key, as that's the module it's in. Next it has 'nodeapi' as the next key, as hook_nodeapi() is what applies to changes in nodes. Finally the keys after that are the various operations for hook_nodeapi() that the node module is exposing as triggers.
| Name | Description |
|---|---|
| Hooks | Allow modules to interact with the Drupal core. |
function hook_hook_info() {
return array(
'node' => array(
'nodeapi' => array(
'presave' => array(
'runs when' => t('When either saving a new post or updating an existing post'),
),
'insert' => array(
'runs when' => t('After saving a new post'),
),
'update' => array(
'runs when' => t('After saving an updated post'),
),
'delete' => array(
'runs when' => t('After deleting a post')
),
'view' => array(
'runs when' => t('When content is viewed by an authenticated user')
),
),
),
);
}