function taxonomy_get_parents_all in Drupal 6
Same name and namespace in other branches
- 4 modules/taxonomy.module \taxonomy_get_parents_all()
- 5 modules/taxonomy/taxonomy.module \taxonomy_get_parents_all()
- 7 modules/taxonomy/taxonomy.module \taxonomy_get_parents_all()
Find all ancestors of a given term ID.
2 calls to taxonomy_get_parents_all()
- forum_nodeapi in modules/
forum/ forum.module - Implementation of hook_nodeapi().
- forum_page in modules/
forum/ forum.pages.inc - Menu callback; prints a forum listing.
File
- modules/
taxonomy/ taxonomy.module, line 796 - Enables the organization of content into categories.
Code
function taxonomy_get_parents_all($tid) {
$parents = array();
if ($tid) {
$parents[] = taxonomy_get_term($tid);
$n = 0;
while ($parent = taxonomy_get_parents($parents[$n]->tid)) {
$parents = array_merge($parents, $parent);
$n++;
}
}
return $parents;
}