function media_vimeo_variable_get in Media: Vimeo 6
Same name and namespace in other branches
- 7 includes/media_vimeo.variables.inc \media_vimeo_variable_get()
Wrapper for variable_get() that uses the Media: Vimeo variable registry.
Parameters
string $name: The variable name to retrieve. Note that it will be namespaced by pre-pending MEDIA_VIMEO_NAMESPACE, as to avoid variable collisions with other modules.
unknown $default: An optional default variable to return if the variable hasn't been set yet. Note that within this module, all variables should already be set in the media_vimeo_variable_default() function.
Return value
unknown Returns the stored variable or its default.
See also
media_vimeo_variable_default()
4 calls to media_vimeo_variable_get()
- media_vimeo_admin_form in includes/
media_vimeo.admin.inc - This form will be displayed both at /admin/settings/media_vimeo and admin/content/emfield.
- template_preprocess_media_vimeo in themes/
media_vimeo.theme.inc - @file media_vimeo/themes/media_vimeo.theme.inc Theme functions for Media: Vimeo.
- _media_vimeo_convert_color in themes/
media_vimeo.theme.inc - Strip any beginning #'s from the color hex code.
- _media_vimeo_migrate_variable in ./
media_vimeo.install - Migrate a variable from the old namespace.
File
- includes/
media_vimeo.variables.inc, line 54 - media_vimeo/includes/media_vimeo.variables.inc Contains the variables and defaults used by Media: Vimeo.
Code
function media_vimeo_variable_get($name, $default = NULL) {
// Allow for an override of the default.
// Useful when a variable is required (like $path), but namespacing still desired.
if (!isset($default)) {
$default = media_vimeo_variable_default($name);
}
// Namespace all variables
$variable_name = MEDIA_VIMEO_NAMESPACE . $name;
return variable_get($variable_name, $default);
}