function media_youtube_variable_get in Media: YouTube 7
Same name and namespace in other branches
- 6 includes/media_youtube.variables.inc \media_youtube_variable_get()
Wrapper for variable_get() using the Media: YouTube variable registry.
Parameters
string $name: The variable name to retrieve. Note that it will be namespaced by pre-pending MEDIA_YOUTUBE_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_youtube_variable_default() function.
Return value
unknown Returns the stored variable or its default.
See also
media_youtube_variable_default()
5 calls to media_youtube_variable_get()
- media_youtube_file_default_displays in includes/
media_youtube.formatters.inc - Implements hook_file_default_displays().
- media_youtube_file_formatter_info in includes/
media_youtube.formatters.inc - Implements hook_file_formatter_info().
- media_youtube_preprocess_media_youtube_video in includes/
themes/ media_youtube.theme.inc - Preprocess function for theme('media_youtube_video').
- theme_media_youtube_embed in includes/
themes/ media_youtube.theme.inc - @todo: get this working
- theme_media_youtube_preview_style in includes/
themes/ media_youtube.theme.inc - Preview for Styles UI.
File
- includes/
media_youtube.variables.inc, line 35 - media_youtube/includes/media_youtube.variables.inc Variable defaults for Media: YouTube.
Code
function media_youtube_variable_get($name, $default = NULL) {
// Allow for an override of the default.
// Useful when a variable is required (like $path), but namespacing is still
// desired.
if (!isset($default)) {
$default = media_youtube_variable_default($name);
}
// Namespace all variables.
$variable_name = MEDIA_YOUTUBE_NAMESPACE . $name;
return variable_get($variable_name, $default);
}