taxonomy_form

Definition

taxonomy_form($vid, $value = 0, $help = NULL, $name = 'taxonomy')
modules/taxonomy.module, line 379

Description

Generate a form element for selecting terms from a vocabulary.

Code

<?php
function taxonomy_form($vid, $value = 0, $help = NULL, $name = 'taxonomy') {
  $vocabulary = taxonomy_get_vocabulary($vid);
  $help = ($help) ? $help : $vocabulary->help;
  if ($vocabulary->required) {
    $blank = 0;
  }
  else {
    $blank = '<'. t('none') .'>';
  }

  return _taxonomy_term_select(check_plain($vocabulary->name), $name, $value, $vid, $help, intval($vocabulary->multiple), $blank);
}
?>
 
 

Drupal is a registered trademark of Dries Buytaert.