Same name and namespace in other branches
  1. 4.6.x includes/bootstrap.inc \variable_del()
  2. 4.7.x includes/bootstrap.inc \variable_del()
  3. 5.x includes/bootstrap.inc \variable_del()
  4. 7.x includes/bootstrap.inc \variable_del()

Unsets a persistent variable.

Case-sensitivity of the variable_* functions depends on the database collation used. To avoid problems, always use lower case for persistent variable names.

Parameters

$name: The name of the variable to undefine.

See also

variable_get(), variable_set()

26 calls to variable_del()
aggregator_uninstall in modules/aggregator/aggregator.install
Implementation of hook_uninstall().
color_scheme_form_submit in modules/color/color.module
Submit handler for color change form.
comment_update_6002 in modules/comment/comment.install
Changed comment settings from global to per-node -- copy global settings to all node types.
contact_uninstall in modules/contact/contact.install
Implementation of hook_uninstall().
drupal_cron_cleanup in includes/common.inc
Shutdown function for cron cleanup.

... See full list

File

includes/bootstrap.inc, line 641
Functions that need to be loaded on every Drupal request.

Code

function variable_del($name) {
  global $conf;
  db_query("DELETE FROM {variable} WHERE name = '%s'", $name);
  cache_clear_all('variables', 'cache');
  unset($conf[$name]);
}