function hs_taxonomy_hierarchical_select_lineage in Hierarchical Select 7.3
Same name and namespace in other branches
- 5.3 modules/hs_taxonomy.module \hs_taxonomy_hierarchical_select_lineage()
- 6.3 modules/hs_taxonomy.module \hs_taxonomy_hierarchical_select_lineage()
Implementation of hook_hierarchical_select_lineage().
File
- modules/
hs_taxonomy.module, line 703 - Implementation of the Hierarchical Select API for the Taxonomy module.
Code
function hs_taxonomy_hierarchical_select_lineage($item, $params) {
$lineage = array();
if (isset($params['root_term']) && $params['root_term'] && $item == 0) {
return array(
0,
);
}
$terms = array_reverse(hs_taxonomy_get_parents_all($item));
foreach ($terms as $term) {
$lineage[] = $term->tid;
}
return $lineage;
}