function _nat_taxonomy_term_children in Node Auto Term [NAT] 6
Same name and namespace in other branches
- 6.2 nat.module \_nat_taxonomy_term_children()
- 7.2 nat.module \_nat_taxonomy_term_children()
- 7 nat.module \_nat_taxonomy_term_children()
Given a taxonomy term, recursively list all its children.
Parameters
$tid: Term ID.
$vid: Vocabulary ID.
Return value
An array of term IDs including the parent term.
1 call to _nat_taxonomy_term_children()
- nat_form_alter in ./
nat.module - Implementation of hook_form_alter().
File
- ./
nat.module, line 628 - NAT - node auto term - is a helper module that automatically creates a term using the same title as a node.
Code
function _nat_taxonomy_term_children($tid, $vid) {
$tids = array(
$tid,
);
$terms = taxonomy_get_children($tid, $vid);
foreach ($terms as $term) {
$tids = array_merge($tids, _nat_taxonomy_term_children($term->tid, $vid));
}
return $tids;
}