function drupal_find_theme_functions

cis7 drupal_find_theme_functions($cache, $prefixes)
cle7 drupal_find_theme_functions($cache, $prefixes)
elmsmedia7 drupal_find_theme_functions($cache, $prefixes)
icor7 drupal_find_theme_functions($cache, $prefixes)
meedjum_blog7 drupal_find_theme_functions($cache, $prefixes)
mooc7 drupal_find_theme_functions($cache, $prefixes)

Allows themes and/or theme engines to discover overridden theme functions.


$cache: The existing cache of theme hooks to test against.

$prefixes: An array of prefixes to test, in reverse order of importance.

Return value

$implementations The functions found, suitable for returning from hook_theme;

1 call to drupal_find_theme_functions()
phptemplate_theme in themes/engines/phptemplate/phptemplate.engine
Implements hook_theme().


includes/, line 1240
The theme system, which controls the output of Drupal.


function drupal_find_theme_functions($cache, $prefixes) {
  $implementations = array();
  $functions = get_defined_functions();

  foreach ($cache as $hook => $info) {
    foreach ($prefixes as $prefix) {
      // Find theme functions that implement possible "suggestion" variants of
      // registered theme hooks and add those as new registered theme hooks.
      // The 'pattern' key defines a common prefix that all suggestions must
      // start with. The default is the name of the hook followed by '__'. An
      // 'base hook' key is added to each entry made for a found suggestion,
      // so that common functionality can be implemented for all suggestions of
      // the same base hook. To keep things simple, deep hierarchy of
      // suggestions is not supported: each suggestion's 'base hook' key
      // refers to a base hook, not to another suggestion, and all suggestions
      // are found using the base hook's pattern, not a pattern from an
      // intermediary suggestion.
      $pattern = isset($info['pattern']) ? $info['pattern'] : ($hook . '__');
      if (!isset($info['base hook']) && !empty($pattern)) {
        $matches = preg_grep('/^' . $prefix . '_' . $pattern . '/', $functions['user']);
        if ($matches) {
          foreach ($matches as $match) {
            $new_hook = substr($match, strlen($prefix) + 1);
            $arg_name = isset($info['variables']) ? 'variables' : 'render element';
            $implementations[$new_hook] = array(
              'function' => $match,
              $arg_name => $info[$arg_name],
              'base hook' => $hook,
      // Find theme functions that implement registered theme hooks and include
      // that in what is returned so that the registry knows that the theme has
      // this implementation.
      if (function_exists($prefix . '_' . $hook)) {
        $implementations[$hook] = array(
          'function' => $prefix . '_' . $hook,

  return $implementations;



Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/ in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/
The website encountered an unexpected error. Please try again later.