You are here

function variable_realm_variable_delete in Variable 7

Same name and namespace in other branches
  1. 7.2 variable_realm/variable_realm.module \variable_realm_variable_delete()

Implements hook_variable_delete().

File

variable_realm/variable_realm.module, line 453
Variable API module - Realms

Code

function variable_realm_variable_delete($variable, $options) {

  // If there's a realm option, we are already deleting variable for a realm only.
  if (empty($options['realm'])) {

    // Delete each variable for each current and existing realm/key
    foreach (variable_children($variable['name']) as $variable_name) {
      foreach (variable_realm_list() as $realm_name => $realm_title) {
        variable_realm_delete_variable($realm_name, $variable_name, FALSE);
      }
    }
    variable_realm_rebuild();
  }
}