You are here

function hs_taxonomy_hierarchical_select_lineage in Hierarchical Select 6.3

Same name and namespace in other branches
  1. 5.3 modules/hs_taxonomy.module \hs_taxonomy_hierarchical_select_lineage()
  2. 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 442
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;
}