taxonomy_del_vocabulary

Versions
4.6 – 6
taxonomy_del_vocabulary($vid)

Delete a vocabulary.

Parameters

$vid A vocabulary ID.

Return value

Constant indicating items were deleted.

Code

modules/taxonomy/taxonomy.module, line 354

<?php
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;
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.