theme_get_setting

Versions
5 – 6
theme_get_setting($setting_name, $refresh = FALSE)
7
theme_get_setting($setting_name, $theme = NULL)

Retrieve a setting for the current theme. This function is designed for use from within themes & engines to determine theme settings made in the admin interface.

Caches values for speed (use $refresh = TRUE to refresh cache)

Parameters

$setting_name The name of the setting to be retrieved.

$refresh Whether to reload the cache of settings.

Return value

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

▾ 9 functions call theme_get_setting()

chameleon_node in drupal/themes/chameleon/chameleon.theme
chameleon_page in drupal/themes/chameleon/chameleon.theme
ctools_page_logo_content_type_render in contributions/ctools/plugins/content_types/page/page_logo.inc
Output function for the 'page_logo' content type.
ctools_page_mission_content_type_render in contributions/ctools/plugins/content_types/page/page_mission.inc
Output function for the 'page_mission' content type.
ctools_page_slogan_content_type_render in contributions/ctools/plugins/content_types/page/page_slogan.inc
Output function for the 'page_slogan' content type.
template_preprocess_comment in drupal/modules/comment/comment.module
Process variables for comment.tpl.php.
template_preprocess_maintenance_page in drupal/includes/theme.maintenance.inc
The variables generated here is a mirror of template_preprocess_page(). This preprocessor will run it's course when theme_maintenance_page() is invoked. It is also used in theme_install_page() and theme_update_page() to keep all the variables…
template_preprocess_node in drupal/includes/theme.inc
Process variables for node.tpl.php
template_preprocess_page in drupal/includes/theme.inc
Process variables for page.tpl.php

Code

drupal/includes/theme.inc, line 1002

<?php
function theme_get_setting($setting_name, $refresh = FALSE) {
  global $theme_key;
  static $settings;

  if (empty($settings) || $refresh) {
    $settings = theme_get_settings($theme_key);

    $themes = list_themes();
    $theme_object = $themes[$theme_key];

    if ($settings['mission'] == '') {
      $settings['mission'] = variable_get('site_mission', '');
    }

    if (!$settings['toggle_mission']) {
      $settings['mission'] = '';
    }

    if ($settings['toggle_logo']) {
      if ($settings['default_logo']) {
        $settings['logo'] = base_path() . dirname($theme_object->filename) .'/logo.png';
      }
      elseif ($settings['logo_path']) {
        $settings['logo'] = base_path() . $settings['logo_path'];
      }
    }

    if ($settings['toggle_favicon']) {
      if ($settings['default_favicon']) {
        if (file_exists($favicon = dirname($theme_object->filename) .'/favicon.ico')) {
          $settings['favicon'] = base_path() . $favicon;
        }
        else {
          $settings['favicon'] = base_path() .'misc/favicon.ico';
        }
      }
      elseif ($settings['favicon_path']) {
        $settings['favicon'] = base_path() . $settings['favicon_path'];
      }
      else {
        $settings['toggle_favicon'] = FALSE;
      }
    }
  }

  return isset($settings[$setting_name]) ? $settings[$setting_name] : NULL;
}
?>

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters (without spaces) shown in the image.