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 .info files of the parent themes 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 1502
The theme system, which controls the output of Backdrop.

Code

function theme_has_settings($theme) {
  if (config_get_names_with_prefix($theme . '.settings')) {
    return TRUE;
  }
  $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;
}