You are here

function media_flickr_update_7008 in Media: Flickr 7.2

Rename variables, removing variable namespace.

File

./media_flickr.install, line 68
Install, update and uninstall functions for the Media: Flickr module.

Code

function media_flickr_update_7008() {

  // Create an array of variables sans 'media_flickr' prefix.
  $variables = array(
    'width',
    'height',
    'autoplay',
    'preview_uri',
    'api_key',
    'api_secret',
  );
  foreach ($variables as $variable) {

    // Find the value of the old variable.
    $value = variable_get('media_flickr__' . $variable);

    // Port the value of the variable if it was set.
    if (!is_null($value)) {
      variable_set('media_flickr_' . $variable, $value);
    }

    // Remove the old variable.
    variable_del('media_flickr__' . $variable);
  }
}