function variable_get_default in Variable 7
Same name and namespace in other branches
- 6 variable.module \variable_get_default()
- 7.2 variable.module \variable_get_default()
Get variable default
Parameters
$variable: Variable name or variable information
Related topics
2 calls to variable_get_default()
- variable_get_value in ./
variable.module - Get value for simple scalar variable
- variable_multiple_get_default in ./
variable.inc - Get defaults for multiple variable
File
- ./
variable.module, line 269 - Variable API module
Code
function variable_get_default($variable, $options = array()) {
$variable = _variable_variable($variable, $options);
if (isset($variable['default callback'])) {
variable_include($variable);
return call_user_func($variable['default callback'], $variable, _variable_options($options));
}
elseif (isset($variable['default'])) {
return $variable['default'];
}
else {
return NULL;
}
}