You are here

function bootstrap_setting in Express 8

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.

See also

\Drupal\bootstrap\Theme::getSetting()

\Drupal\bootstrap\Bootstrap::getTheme()

File

themes/contrib/bootstrap/deprecated.php, line 863
This contains deprecated functions that will be removed in a future release.

Code

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);
}