function _bootstrap_get_base_themes
8.x-3.x deprecated.php | _bootstrap_get_base_themes($theme_key = NULL, $include_theme_key = FALSE) |
7.x-3.x common.inc | _bootstrap_get_base_themes($theme_key = NULL, $include_theme_key = FALSE) |
Returns a list of base themes for active or provided theme.
// Before (including active theme).
$base_themes = _bootstrap_get_base_themes(NULL, TRUE);
// Before (excluding active theme).
$base_themes = _bootstrap_get_base_themes('my_subtheme');
// After (including active theme).
use Drupal\bootstrap\Bootstrap;
$theme = Bootstrap::getTheme();
$base_themes = array_keys($theme->getAncestry());
// After (excluding active theme).
use Drupal\bootstrap\Bootstrap;
$my_subtheme = Bootstrap::getTheme('my_subtheme');
$base_themes = array_keys($my_subtheme->getAncestry());
array_pop($base_themes);
Parameters
string $theme_key: The machine name of the theme to check, if not set the active theme name will be used.
bool $include_theme_key: Whether to append the returned list with $theme_key.
Return value
array An indexed array of base themes.
Deprecated
Will be removed in a future release.
See Also
Source ./deprecated.php (line 304)
function _bootstrap_get_base_themes($theme_key = NULL, $include_theme_key = FALSE) {
Bootstrap::deprecated();
$themes = array_keys(Bootstrap::getTheme($theme_key)->getAncestry());
if (!$include_theme_key) {
array_pop($themes);
}
return $themes;
}