function bootstrap_setting

8.x-3.x deprecated.php bootstrap_setting($name, $theme = NULL, $prefix = 'bootstrap', $default = NULL)
7.x-3.x common.inc bootstrap_setting($name, $theme = NULL, $prefix = 'bootstrap', $default = NULL)

Retrieves a setting for the current theme or for a given theme.

This is a wrapper for theme_get_setting(), ensuring to use deprecated setting values instead.

@todo Refactor in 7.x-4.x and get rid of the deprecated settings.

Parameters

string $name: The name of the setting to be retrieved.

string $theme: The name of a given theme; defaults to the currently active theme.

string $prefix: The prefix used on the $name of the setting, this will be appended with "_" automatically if set.

mixed $default: The default value to return if setting doesn't exist or is not set.

Return value

mixed The value of the requested setting, NULL if the setting does not exist.

Related topics

Source includes/common.inc (line 399)

function bootstrap_setting($name, $theme = NULL, $prefix = 'bootstrap', $default = NULL) {
  $prefix = !empty($prefix) ? $prefix . '_' : '';
  $setting = theme_get_setting($prefix . $name, $theme);
  switch ($prefix . $name) {
    case 'bootstrap_cdn_provider':
      $deprecated = theme_get_setting('bootstrap_cdn', $theme);
      if (isset($deprecated)) {
        $setting = empty($deprecated) ? '' : 'jsdelivr';
      }
      break;

    case 'bootstrap_cdn_jsdelivr_version':
      $deprecated = theme_get_setting('bootstrap_cdn', $theme);
      if (isset($deprecated)) {
        $setting = empty($deprecated) ? BOOTSTRAP_VERSION : $deprecated;
      }
      break;

    case 'bootstrap_cdn_jsdelivr_theme':
      $deprecated = theme_get_setting('bootstrap_bootswatch', $theme);
      if (isset($deprecated)) {
        $setting = empty($deprecated) ? 'bootstrap' : $deprecated;
      }
      break;

    case 'bootstrap_forms_smart_descriptions':
      $deprecated = theme_get_setting('bootstrap_tooltip_descriptions', $theme);
      if (isset($deprecated)) {
        $setting = (int) !empty($deprecated);
      }
      break;

    case 'bootstrap_forms_smart_descriptions_limit':
      $deprecated = theme_get_setting('bootstrap_tooltip_descriptions_length', $theme);
      if (isset($deprecated)) {
        $setting = (int) !empty($deprecated);
      }
      break;

  }
  return isset($setting) ? $setting : $default;
}