summaryrefslogtreecommitdiff
path: root/includes/common.inc
diff options
context:
space:
mode:
Diffstat (limited to 'includes/common.inc')
-rw-r--r--includes/common.inc16
1 files changed, 16 insertions, 0 deletions
diff --git a/includes/common.inc b/includes/common.inc
index 90be49c5a..2a93e7999 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -4520,6 +4520,22 @@ function drupal_alter($type, &$data, &$context1 = NULL, &$context2 = NULL) {
$function = $module . '_' . $hook;
$function($data, $context1, $context2);
}
+ // Allow the theme to alter variables after the theme system has been
+ // initialized.
+ global $theme, $base_theme_info;
+ if (isset($theme)) {
+ $theme_keys = array();
+ foreach ($base_theme_info as $base) {
+ $theme_keys[] = $base->name;
+ }
+ $theme_keys[] = $theme;
+ foreach ($theme_keys as $theme_key) {
+ $function = $theme_key . '_' . $hook;
+ if (function_exists($function)) {
+ $function($data, $context1, $context2);
+ }
+ }
+ }
}
/**