diff --git a/includes/theme.inc b/includes/theme.inc index 542721b85b03fec700e8b4f6538a1def9cb3dd6b..19cb0a0866c327fbdd41c4ee1529dffd51383b25 100644 --- a/includes/theme.inc +++ b/includes/theme.inc @@ -278,11 +278,18 @@ function _theme_process_registry(&$cache, $name, $type, $theme, $path) { } } - if (function_exists($prefix .'_preprocess')) { - $info['preprocess functions'][] = $prefix .'_preprocess'; + // Let the theme engine register theme specific variable functions. + $prefixes[] = $prefix; + if ($type == 'theme_engine') { + $prefixes[] = $theme; } - if (function_exists($prefix .'_preprocess_'. $hook)) { - $info['preprocess functions'][] = $prefix .'_preprocess_'. $hook; + foreach ($prefixes as $prefix) { + if (function_exists($prefix .'_preprocess')) { + $info['preprocess functions'][] = $prefix .'_preprocess'; + } + if (function_exists($prefix .'_preprocess_'. $hook)) { + $info['preprocess functions'][] = $prefix .'_preprocess_'. $hook; + } } } if (isset($cache[$hook]['preprocess functions']) && is_array($cache[$hook]['preprocess functions']) && empty($cache[$hook]['override preprocess functions'])) {