| Versionen | |
|---|---|
| drupal6 | taxonomy_get_term($tid, $reset = FALSE) |
Return the term object matching a term ID.
$tid A term's ID
$reset Whether to reset the internal taxonomy_get_term cache.
Object A term object. Results are statically cached.
modules/
<?php
function taxonomy_get_term($tid, $reset = FALSE) {
static $terms = array();
if ($reset) {
$terms = array();
}
if (!isset($terms[$tid])) {
$terms[$tid] = db_fetch_object(db_query('SELECT * FROM {term_data} WHERE tid = %d', $tid));
}
return $terms[$tid];
}
?>
Kommentare
Kommentar hinzufügen