You are here

function variable_get_default in Variable 6

Same name and namespace in other branches
  1. 7.2 variable.module \variable_get_default()
  2. 7 variable.module \variable_get_default()

Get variable default

1 call to variable_get_default()
variable_get_value in ./variable.module
Get value for simple scalar variable

File

./variable.module, line 107
Variable API module

Code

function variable_get_default($name, $options = array()) {
  $options += variable_status();
  if ($variable = variable_info($name, $options)) {
    if (isset($variable['default_callback'])) {
      return call_user_func($variable['default_callback'], $variable, $options);
    }
    elseif (isset($variable['default'])) {
      return $variable['default'];
    }
  }
  return NULL;
}