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.

  // Before ("button_colorize" and "my_subtheme_custom_option").
  $colorize = bootstrap_setting('button_colorize', 'my_subtheme');
  $custom_option = bootstrap_setting('custom_option', 'my_subtheme', 'my_subtheme');

  // After ("button_colorize" and "my_subtheme_custom_option").
  use Drupal\bootstrap\Bootstrap;
  $my_subtheme = Bootstrap::getTheme('my_subtheme');
  $my_subtheme->getSetting('button_colorize');
  $my_subtheme->getSetting('my_subtheme_custom_option');

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.

Deprecated

Will be removed in a future release.

Source ./deprecated.php (line 933)

function bootstrap_setting($name, $theme = NULL, $prefix = 'bootstrap', $default = NULL) {
  Bootstrap::deprecated();
  $theme = Bootstrap::getTheme($theme);
  $prefix = $prefix !== 'bootstrap' && !empty($prefix) ? $prefix . '_' : '';
  return $theme->getSetting($prefix . $name, $default);
}