You are here

function emapi_variable_get in Embedded Media Field 6.3

Wrapper for variable_get() using the Embedded Media API variable registry.

Parameters

string $name: The variable name to retrieve. Note that it will be namespaced by pre-pending EMAPI_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 emapi_variable_default() function.

Return value

unknown Returns the stored variable or its default.

See also

emapi_variable_set()

emapi_variable_del()

emapi_variable_default()

2 calls to emapi_variable_get()
emapi_admin_list_page in emapi/includes/emapi.admin.inc
Page callback for admin/content/emapi.
_emapi_retrieve_xml in emapi/includes/emapi.xml.inc
A wrapper around simplexml to retrieve a given XML file.

File

emapi/includes/emapi.variables.inc, line 37
Contains the variables and defaults used by Embedded Media API.

Code

function emapi_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 = emapi_variable_default($name);
  }

  // Namespace all variables.
  $variable_name = EMAPI_NAMESPACE . $name;
  return variable_get($variable_name, $default);
}