taxonomy_del_vocabulary

Definition

taxonomy_del_vocabulary($vid)
modules/taxonomy/taxonomy.module, line 232

Description

Delete a vocabulary.

Parameters

$vid A vocabulary ID.

Return value

Constant indicating items were deleted.

Code

<?php
function taxonomy_del_vocabulary($vid) {
  $vocabulary = (array) taxonomy_vocabulary_load($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;
}
?>
 
 

Drupal is a registered trademark of Dries Buytaert.