function hs_taxonomy_hierarchical_select_lineage in Hierarchical Select 5.3
Same name and namespace in other branches
- 6.3 modules/hs_taxonomy.module \hs_taxonomy_hierarchical_select_lineage()
- 7.3 modules/hs_taxonomy.module \hs_taxonomy_hierarchical_select_lineage()
Implementation of hook_hierarchical_select_lineage().
2 calls to hs_taxonomy_hierarchical_select_lineage()
- hs_content_taxonomy_hierarchical_select_lineage in modules/
hs_content_taxonomy.module - Implementation of hook_hierarchical_select_lineage().
- hs_taxonomy_views_hierarchical_select_lineage in modules/
hs_taxonomy_views.module - Implementation of hook_hierarchical_select_lineage().
File
- modules/
hs_taxonomy.module, line 249 - Implementation of the Hierarchical Select API for the Taxonomy module.
Code
function hs_taxonomy_hierarchical_select_lineage($item, $params) {
$lineage = array();
if ($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;
}