function tft_is_term_archived in Taxonomy File Tree 7.2
Same name and namespace in other branches
- 7 tft.module \tft_is_term_archived()
2 calls to tft_is_term_archived()
File
- ./
tft.module, line 1263 - Hook implementations and module logic for TFT.
Code
function tft_is_term_archived($tid) {
$og_nid = tft_get_og_nid($tid);
$og_tid = tft_get_og_tid($og_nid);
$archive_tid = tft_get_archive_tid($og_tid);
$root_tid = $tid;
$depth = tft_get_depth($tid);
while ($depth > 1 && $root_tid) {
$root_tid = db_query("SELECT parent FROM {taxonomy_term_hierarchy} WHERE tid = :tid", array(
':tid' => $tid,
))
->fetchField();
$depth--;
}
return $root_tid == $archive_tid;
}