You are here

function ds_variable_get in Display Suite 6.2

Same name and namespace in other branches
  1. 6.3 ds.module \ds_variable_get()

Module-aware version of variable_get.

This searches through several modules trying to find a set variable, eventually defaulting to core. It also checks the unreleased 'variable' module, which is currently only available by building from its repository.

Parameters

string $var_name: The variable to find

string $default: (Optional) An optional default value

File

./ds.module, line 175
Core functions for the Display Suite module.

Code

function ds_variable_get($var_name, $default = '') {
  if (ds_static_variables($var_name)) {
    $value = ds_static_variables($var_name);
  }
  elseif (module_exists('variable') && function_exists('variable_get_value')) {
    global $language;
    $value = variable_get_value($var_name, array(
      'default' => $default,
      'language' => $language,
    ));
  }
  else {
    $value = variable_get($var_name, $default);
  }
  return $value;
}