1 theme.inc theme_has_settings($theme)

Detect if a theme has any theme settings.

This utility function checks a theme's .info file for any settings. If the theme has a base theme, it loops through the parent themes .info files as well.

Parameters

string $theme: The theme name to be checked for settings.

Return value

bool TRUE if the theme has settings, FALSE otherwise.

File

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

Code

function theme_has_settings($theme) {
  $themes = list_themes();
  $theme_info = $themes[$theme];
  if (!empty($theme_info->info['settings'])) {
    return TRUE;
  }
  if (isset($theme_info->info['base theme'])) {
    return theme_has_settings($theme_info->info['base theme']);
  }
  return FALSE;
}