function theme_get_setting
Retrieves a setting for the current theme or for a given theme.
The final setting is obtained from the last value found in the following sources:
- the saved values from the global theme settings form
- the saved values from the theme's settings form
To only retrieve the default global theme setting, an empty string should be given for $theme.
Parameters
string $setting_name: The name of the setting to be retrieved.
string $theme: The name of a given theme; defaults to the current theme.
Return value
mixed The value of the requested setting, NULL if the setting does not exist.
Deprecated
in drupal:11.3.0 and is removed from drupal:13.0.0. Use \Drupal::service('Drupal\Core\Extension\ThemeSettingsProvider')->getSetting() instead.
See also
https://www.drupal.org/node/3035289
File
-
core/
includes/ theme.inc, line 211
Code
function theme_get_setting($setting_name, $theme = NULL) {
@trigger_error('theme_get_setting() is deprecated in drupal:11.3.0 and is removed from drupal:13.0.0. Use \\Drupal::service(\'\\Drupal\\Core\\Extension\\ThemeSettingsProvider\')->getSetting() instead. See https://www.drupal.org/node/3035289', E_USER_DEPRECATED);
return \Drupal::service(ThemeSettingsProvider::class)->getSetting($setting_name, $theme);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.