You are here

function taxonomy_del_vocabulary in Drupal 4

Same name and namespace in other branches
  1. 5 modules/taxonomy/taxonomy.module \taxonomy_del_vocabulary()
  2. 6 modules/taxonomy/taxonomy.module \taxonomy_del_vocabulary()
2 calls to taxonomy_del_vocabulary()
taxonomy_save_vocabulary in modules/taxonomy.module
taxonomy_vocabulary_confirm_delete_submit in modules/taxonomy.module

File

modules/taxonomy.module, line 309
Enables the organization of content into categories.

Code

function taxonomy_del_vocabulary($vid) {
  $vocabulary = (array) taxonomy_get_vocabulary($vid);
  db_query('DELETE FROM {vocabulary} WHERE vid = %d', $vid);
  db_query('DELETE FROM {vocabulary_node_types} WHERE vid = %d', $vid);
  $result = db_query('SELECT tid FROM {term_data} WHERE vid = %d', $vid);
  while ($term = db_fetch_object($result)) {
    taxonomy_del_term($term->tid);
  }
  module_invoke_all('taxonomy', 'delete', 'vocabulary', $vocabulary);
  cache_clear_all();
  return SAVED_DELETED;
}