diff --git a/api.module b/api.module
index 48b7d7c..36b84ed 100644
--- a/api.module
+++ b/api.module
@@ -2031,7 +2031,7 @@ function api_cron() {
  *   Code with function names formatted as links.
  */
 function api_link_code($code, $branch, $class_did = NULL) {
-  return _api_link_documentation($code, $branch, $class_did, array('code function', 'code string'));
+  return _api_link_documentation($code, $branch, $class_did, array('code hook name', 'code theme hook name', 'code function', 'code string'));
 }
 
 /**
@@ -2112,6 +2112,13 @@ function _api_link_documentation($documentation, $branch, $class_did = NULL, $st
     // '('.
     'function' => '!(?<=^|\s)([a-zA-Z0-9_:]+)\(!',
 
+    // Find potential hook names in marked-up code inside a module_implements()
+    // or module_invoke_all() call.
+    'code hook name' => '!(?<=module_invoke_all</span>\(|module_implements</span>\()<span class="php-string">\'([a-zA-Z0-9_]+)\'</span>!',
+
+    // Find potential theme hook names in marked-up code inside a theme() call.
+    'code theme hook name' => '!(?<=theme</span>\()<span class="php-string">\'([a-zA-Z0-9_]+)\'</span>!',
+
     // Find function names in marked-up code.
     'code function' => '!<span class="php-function-or-constant">([a-zA-Z0-9_]+)</span>!',
 
@@ -2162,6 +2169,22 @@ function _api_link_documentation($documentation, $branch, $class_did = NULL, $st
       $prepend_if_not_found = '<span class="php-string">\'';
       $use_php = FALSE;
       break;
+
+    case 'code hook name':
+      $prepend = '<span class="php-function-or-constant">\'';
+      $append = '\'</span>';
+      $prepend_if_not_found = '<span class="php-string">\'';
+      $use_php = FALSE;
+      $prefix = 'hook_';
+      break;
+
+    case 'code theme hook name':
+      $prepend = '<span class="php-function-or-constant">\'';
+      $append = '\'</span>';
+      $prepend_if_not_found = '<span class="php-string">\'';
+      $use_php = FALSE;
+      $prefix = 'theme_';
+      break;
   }
 
   if (count($stages) > 0) {
@@ -2171,7 +2194,7 @@ function _api_link_documentation($documentation, $branch, $class_did = NULL, $st
     $callback = NULL;
   }
 
-  return api_split($patterns[$stage], $documentation, $callback_match, array($branch, $prepend, $append, $class_did, NULL, NULL, $use_php, $prepend_if_not_found), $callback, array($branch, $class_did, $stages));
+  return api_split($patterns[$stage], $documentation, $callback_match, array($branch, $prepend, $append, $class_did, NULL, NULL, $use_php, $prepend_if_not_found, NULL, $prefix), $callback, array($branch, $class_did, $stages));
 }
 
 /**
@@ -2247,11 +2270,13 @@ function api_split($pattern, $subject, $callback_match = NULL, $callback_match_a
  *   Text to prepend if object is not found (defaults to $prepend).
  * @param $append_if_not_found
  *   Text to append if object is not found (defaults to $append).
+ * @param $prefix
+ *   Prefix for $name when looking for a matching object.
  *
  * @return
  *   The text as a link to the object page.
  */
-function api_link_name($name, $branch, $prepend = '', $append = '', $class_did = NULL, $text = NULL, $is_link = FALSE, $use_php = TRUE, $prepend_if_not_found = NULL, $append_if_not_found = NULL) {
+function api_link_name($name, $branch, $prepend = '', $append = '', $class_did = NULL, $text = NULL, $is_link = FALSE, $use_php = TRUE, $prepend_if_not_found = NULL, $append_if_not_found = NULL, $prefix = '') {
   static $local_objects = array(), $php_functions;
 
   if (!isset($local_objects[$class_did])) {
@@ -2343,8 +2368,8 @@ function api_link_name($name, $branch, $prepend = '', $append = '', $class_did =
   if ($is_link && isset($local_objects[$class_did]['group'][$name])) {
     return $prepend . l($text, $local_objects[$class_did]['group'][$name]['url'], $local_objects[$class_did]['group'][$name]['options']) . $append;
   }
-  elseif (isset($local_objects[$class_did]['item'][$name])) {
-    return $prepend . l($text, $local_objects[$class_did]['item'][$name]['url'], $local_objects[$class_did]['item'][$name]['options']) . $append;
+  elseif (isset($local_objects[$class_did]['item'][$prefix . $name])) {
+    return $prepend . l($text, $local_objects[$class_did]['item'][$prefix . $name]['url'], $local_objects[$class_did]['item'][$prefix . $name]['options']) . $append;
   }
   elseif ($use_php && isset($php_functions[$name])) {
     $link = strtr(variable_get('api_php_funcpath', 'http://php.net/!function'), array('!function' => $name));
