global $theme_path needs to be documented properly

Created on 22 December 2010, over 14 years ago
Updated 3 April 2025, about 1 month ago

Labeling this as a bug for the theme system, but it might also just be a doc issue.

The globals $theme, $theme_key, $theme_info always refer to the 'active' theme.

$theme_path does not. To reproduce:

1. Put this in the THEME_preprocess_html function of theme1:

global $theme_path;
print $theme_path;

2. Create a subtheme 'theme2' of theme1.

3. Make theme2 the active theme.

4. Observe that the code above outputs the path to theme1, not the path to theme2.

Doing the same with $theme/$theme_info/$theme_key will give you the name/info for theme2.

Is this intended behavior? It seems off to me, but there may be a good reason for having it this way. It definitely should be documented---right now, the doc says of all these variables that they give the path/name/info of `the active theme', suggesting that they all pertain to the same theme in the same environment, always.

🐛 Bug report
Status

Closed: won't fix

Component

API documentation files

Created by

🇩🇪Germany sven.lauer Frankfurt

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024