You are here

function taxonomy_term_depth_get_children in Taxonomy Term Depth 7

Same name and namespace in other branches
  1. 8.2 taxonomy_term_depth.module \taxonomy_term_depth_get_children()
  2. 8 taxonomy_term_depth.module \taxonomy_term_depth_get_children()

Gets children of the term.

Parameters

$tid:

Return value

array

1 call to taxonomy_term_depth_get_children()
taxonomy_term_depth_get_full_chain in ./taxonomy_term_depth.module
Gets full chain of terms, including term itself

File

./taxonomy_term_depth.module, line 171
Provides some custom functionality.

Code

function taxonomy_term_depth_get_children($tid, $reversed = FALSE) {
  $children = [];

  // Now get children
  $child = $tid;
  while ($child = taxonomy_term_depth_get_child($child)) {
    $children[] = $child;
  }
  return $reversed ? array_reverse($children) : $children;
}