1 theme.inc path_to_theme()

Returns the path to the current themed element.

It can point to the active theme or the module that handles the theme implementation. For example:

  • When invoked within the scope of a theme function it will depend on where where that theme function is being handled.
  • If implemented from a module, it will point to the module.
  • If implemented from the active theme, it will point to the active theme.
  • When called outside the scope of a theme function call, it will always point to the active theme.

File

core/includes/theme.inc, line 1239
The theme system, which controls the output of Backdrop.

Code

function path_to_theme() {
  global $theme_path;

  if (!isset($theme_path)) {
    backdrop_theme_initialize();
  }

  return $theme_path;
}