_taxonomy_term_children

Хочешь помочь с переводом? Это очень просто и быстро. Лишь зарегистрируйся, и можешь тут же начать переводить.

modules/taxonomy/taxonomy.module, строка 930

Версии
5 – 6
_taxonomy_term_children($tid)

Helper for taxonomy_term_count_nodes(). Used to find out which terms are children of a parent term.

Параметры

$tid The parent term's ID

Возвращаемое значение

array An array of term IDs representing the children of $tid. Results are statically cached.

▾ 1 функция вызывает _taxonomy_term_children()

taxonomy_term_count_nodes in modules/taxonomy/taxonomy.module
Считает число опубликованных нод, содержащих терм.

Код

<?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 isset($children[$tid]) ? $children[$tid] : array();
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии

Вход в систему