You are here

function media_youtube_variable_get in Media: YouTube 6

Same name and namespace in other branches
  1. 7 includes/media_youtube.variables.inc \media_youtube_variable_get()

Wrapper for variable_get() that uses 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_set()

media_youtube_variable_del()

media_youtube_variable_default()

15 calls to media_youtube_variable_get()
emvideo_youtube_preview in providers/emvideo/youtube.inc
hook emvideo_PROVIDER_video this actually displays the preview-sized video we want, commonly for the teaser
emvideo_youtube_video in providers/emvideo/youtube.inc
hook emvideo_PROVIDER_video this actually displays the full/normal-sized video we want, usually on the default page view
media_youtube_admin_form in includes/media_youtube.admin.inc
This form will be displayed both at /admin/settings/media_youtube and admin/content/emfield.
media_youtube_config in includes/media_youtube.media_mover.inc
Media Mover configuration form element for Media: YouTube.
media_youtube_cron in ./media_youtube.module
Implementation of hook_cron().

... See full list

File

includes/media_youtube.variables.inc, line 71
Contains the variables and defaults used by 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 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);
}