hook_notifications()

Last updated on
30 April 2025

hook_notifications()

hook_notifications() is quite different in version 7.x-1.x:

/**
 * Implementation of hook_notifications()
 */
function hook_notifications($op) {

}

$op will be one of a number of items:

- 'object types'
- 'event types'
- 'field types'
- 'subscription types'
- 'message templates'
- 'display options'
- 'event classes'
- 'event actions'

More documentation on these items needs to be written; in the meantime notifications_content module provides a lot of (quite hard to understand) examples.

Altering hook_notifications()

hook_notifications() has no alter hook. Instead, each individual type (passed to $op in hook_notifications) has a separate hook. For example, to alter the subscription data returned by modules implementing hook_notifications(), implement hook_notifications_subscription_types_alter():


/**
 * Implements hook_notifications_NOTIFICATION_TYPE_alter()
 * 
 * @param array $items
 */
function hook_notifications_subscription_types_alter(&$items) {
  //Do something
}

Help improve this page

Page status: Not set

You can: