Get taxonomy terms as array for select box

Public

Get one level array of terms for selectbox

Get raw version
php
  1. function MODULE_selectbox_contents($vid) {
  2. $terms = taxonomy_get_tree($vid);
  3.  
  4. foreach ($terms as $data) {
  5. $output[$data->tid] = $data->name;
  6. }
  7.  
  8. return $output;
  9. }