You are here

function taxonomy_hierarchical_select_lineage in Hierarchical Select 5

Same name and namespace in other branches
  1. 5.2 modules/taxonomy.inc \taxonomy_hierarchical_select_lineage()

Implementation of hook_hierarchical_select_lineage().

File

modules/taxonomy.inc, line 142

Code

function taxonomy_hierarchical_select_lineage($item) {
  if (!is_numeric($item) || $item == -1) {
    $lineage = array();
  }
  else {
    $terms = array_reverse(taxonomy_get_parents_all($item));
    foreach ($terms as $term) {
      $lineage[] = $term->tid;
    }
  }
  return $lineage;
}