function vars_node_type_delete in Variable API 7
Same name and namespace in other branches
- 7.2 vars.module \vars_node_type_delete()
Implements hook_node_type_delete().
File
- ./
vars.module, line 444 - Implement an API to handle persistent variables.
Code
function vars_node_type_delete($info) {
global $conf;
$names = array();
$variables = Vars::loadDefaults('node_type');
if (array_key_exists('dynamic', $variables)) {
foreach (array_keys($variables['dynamic']) as $var) {
$names[] = $var->name . '_' . $info->type;
unset($conf[$var->name . '_' . $info->type]);
}
}
if (!empty($names)) {
db_delete('variable')
->condition('name', $names, 'IN')
->execute();
cache_clear_all('variables', 'cache_bootstrap');
}
}