function bootstrap_setting

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

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.

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 863)

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