Описание тега drupal-hooks
In Drupal terminology, the PHP functions used to extend the functionality of Drupal core modules or third-party modules are called hooks.
Hooks are just normal PHP functions which allow a user to extend functionality within Drupal. They are used by Drupal core, and contributed modules. More information can be found at http://api.drupal.org/api/drupal, which has a page listing all the hooks used by Drupal core code.
Implementing hooks
To implement a hook you must create a module, and add a hook function to it. The actual hook implementation function name will replace the word 'hook' in the function name with the name of your custom module. Thus hook_query_alter()
becomes mymodule_query_alter()
. Drupal maintains a list of all included hooks for the site by searching the enabled modules for functions using that naming pattern.