You are here

function taxonomy_defaults_taxonomy in Taxonomy Defaults 7

Same name and namespace in other branches
  1. 6.2 taxonomy_defaults.module \taxonomy_defaults_taxonomy()
  2. 6 taxonomy_defaults.module \taxonomy_defaults_taxonomy()

Implements hook_taxonomy().

Clean up taxonomy default settings on deletion of a taxonomy vocabulary

File

./taxonomy_defaults.module, line 143
Taxonomy defaults - allows assignment of default terms to node types, either

Code

function taxonomy_defaults_taxonomy($op, $type, $args = NULL) {
  if ($op == 'delete') {
    if ($type == 'taxonomy_vocabulary') {
      $vid = $args['vid'];
      foreach (node_type_get_types() as $type => $name) {
        _taxonomy_defaults_clear_settings($type, $vid);
      }
    }
    elseif ($type == 'term') {

      //todo - search all taxdef settings and delete this term. maybe not worth the effort?
    }
  }
}