hook_hook_info()
Defines one or more hooks that are exposed by a module.
Normally hooks do not need to be explicitly defined. However, by declaring a hook explicitly, a module may define a "group" for it. Modules that implement a hook may then place their implementation in either $module.module or in $module.$group.inc. If the hook is located in $module.$group.inc, then that file will be automatically loaded when needed. In general, hooks that are rarely invoked and/or are very large should be placed in a separate include file, while hooks that are very short or very frequently called should be left in the main module file so that they are always available.
See system_hook_info() for all hook groups defined by Drupal core.
An associative array whose keys are hook names and whose values are an associative array containing:
hook_hook_info_alter()
function hook_hook_info() { $hooks['token_info'] = array( 'group' => 'tokens', ); $hooks['tokens'] = array( 'group' => 'tokens', ); return $hooks; }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Extension!module.api.php/function/hook_hook_info/8.1.x