taxonomy_get_term

Definition

taxonomy_get_term($tid)
modules/taxonomy/taxonomy.module, line 1011

Description

Return the term object matching a term ID.

Parameters

$tid A term's ID

Return value

Object A term object. Results are statically cached.

Code

<?php
function taxonomy_get_term($tid) {
  static $terms = array();

  if (!isset($terms[$tid])) {
    $terms[$tid] = db_fetch_object(db_query('SELECT * FROM {term_data} WHERE tid = %d', $tid));
  }

  return $terms[$tid];
}
?>
 
 

Drupal is a registered trademark of Dries Buytaert.