Hook

Drupal

Hooks let developers interact with Drupal programmatically when certain events occur by taking control, executing code, and letting the original process take over again. Examples include hook_form_alter (modify forms before they're rendered), hook_cache_flush (act on Drupal's caches being emptied), hook_cron (periodically execute maintenance tasks), and hook_entity_access (add custom logic to determine if a given user is allowed to access a given entity).