diff --git a/core/includes/theme.inc b/core/includes/theme.inc index dad6f65..fc6d7a8 100644 --- a/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -537,12 +537,15 @@ function _theme($hook, $variables = array()) { // If an array of hook candidates were passed, use the first one that has an // implementation. + $original_suggestions = array(); if (is_array($hook)) { foreach ($hook as $candidate) { if ($theme_registry->has($candidate)) { break; } } + // Store the passed in hooks as theme hook suggestions. + $original_suggestions = $hook; $hook = $candidate; } // Save the original theme hook, so it can be supplied to theme variable @@ -637,6 +640,7 @@ function _theme($hook, $variables = array()) { if (isset($info['base hook'])) { $suggestions[] = $hook; } + $suggestions = array_merge($suggestions, $original_suggestions); // Invoke hook_theme_suggestions_alter() and // hook_theme_suggestions_HOOK_alter(). @@ -657,6 +661,9 @@ function _theme($hook, $variables = array()) { break; } } + // Add the suggestions to the $info array so that preprocess callbacks can + // act on that information. + $info['suggestions'] = $suggestions; // Invoke the variable preprocessors, if any. if (isset($info['base hook'])) {