From 269da037266e555c256d4e5f8ca82a64b452a37b Mon Sep 17 00:00:00 2001
From: Angie Byron <webchick@24967.no-reply.drupal.org>
Date: Thu, 29 Apr 2010 04:47:31 +0000
Subject: [PATCH] #777080 by jhodgdon: Fixed hook_hook_info_alter() is not
 documented.

---
 modules/system/system.api.php | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/modules/system/system.api.php b/modules/system/system.api.php
index a0fc4c0f4caa..02cf2747a9ad 100644
--- a/modules/system/system.api.php
+++ b/modules/system/system.api.php
@@ -32,6 +32,8 @@
  *     exists, and automatically load it when required.
  *
  * See system_hook_info() for all hook groups defined by Drupal core.
+ *
+ * @see hook_hook_info_alter().
  */
 function hook_hook_info() {
   $hooks['token_info'] = array(
@@ -43,6 +45,21 @@ function hook_hook_info() {
   return $hooks;
 }
 
+/**
+ * Alter information from hook_hook_info().
+ *
+ * @param $hooks
+ *   Information gathered by module_hook_info() from other modules'
+ *   implementations of hook_hook_info(). Alter this array directly.
+ *   See hook_hook_info() for information on what this may contain.
+ */
+function hook_hook_info_alter(&$hooks) {
+  // Our module wants to completely override the core tokens, so make
+  // sure the core token hooks are not found.
+  $hooks['token_info']['group'] = 'mytokens';
+  $hooks['tokens']['group'] = 'mytokens';
+}
+
 /**
  * Inform the base system and the Field API about one or more entity types.
  *
-- 
GitLab