$tree) { $options[0] = '---'; // todo this might break with huge vocs $voc = taxonomy_vocabulary_machine_name_load($tree['vocabulary']); foreach (taxonomy_get_tree($voc->vid) as $term) { $options[$term->tid] = str_repeat('- ', $term->depth) . $term->name; } $form['field']['settings']['allowed_values'][$delta]['parent'] = array( '#type' => 'select', '#title' => t('Parent'), '#options' => $options, '#default_value' => isset($tree['parent']) ? $tree['parent'] : 3, ); } } }