_taxonomy_term_children

  1. drupal
    1. 4.7
    2. 5 taxonomy.module
    3. 6 taxonomy.module
Versions
4.7 – 6 _taxonomy_term_children($tid)

Helper for taxonomy_term_count_nodes().

Code

modules/taxonomy.module, line 971

<?php
function _taxonomy_term_children($tid) {
  static $children;

  if (!isset($children)) {
    $result = db_query('SELECT tid, parent FROM {term_hierarchy}');
    while ($term = db_fetch_object($result)) {
      $children[$term->parent][] = $term->tid;
    }
  }
  return $children[$tid] ? $children[$tid] : array();
}
?>