function autocomplete_deluxe_allowed_terms in Autocomplete Deluxe 7.2
Same name and namespace in other branches
- 7 autocomplete_deluxe.module \autocomplete_deluxe_allowed_terms()
Returns all allowed terms for a field without any prefix.
File
- ./
autocomplete_deluxe.module, line 157 - Define enhanced autocomplete wdiget.
Code
function autocomplete_deluxe_allowed_terms($field) {
$options = array();
foreach ($field['settings']['allowed_values'] as $tree) {
if ($vocabulary = taxonomy_vocabulary_machine_name_load($tree['vocabulary'])) {
if ($terms = taxonomy_get_tree($vocabulary->vid, $tree['parent'])) {
foreach ($terms as $term) {
$options[$term->name] = $term->name;
}
}
}
}
return $options;
}