Same name and namespace in other branches
  1. 4.6.x modules/taxonomy.module \taxonomy_get_term()
  2. 4.7.x modules/taxonomy.module \taxonomy_get_term()
  3. 5.x modules/taxonomy/taxonomy.module \taxonomy_get_term()

Return the term object matching a term ID.

Parameters

$tid: A term's ID

$reset: Whether to reset the internal taxonomy_get_term cache.

Return value

Object A term object. Results are statically cached.

7 calls to taxonomy_get_term()
forum_confirm_delete in modules/forum/forum.admin.inc
Returns a confirmation page for deleting a forum taxonomy term.
forum_get_topics in modules/forum/forum.module
taxonomy_del_term in modules/taxonomy/taxonomy.module
Delete a term.
taxonomy_get_parents_all in modules/taxonomy/taxonomy.module
Find all ancestors of a given term ID.
taxonomy_select_nodes in modules/taxonomy/taxonomy.module
Finds all nodes that match selected taxonomy conditions.

... See full list

File

modules/taxonomy/taxonomy.module, line 1083
Enables the organization of content into categories.

Code

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];
}