You are here

function taxonomy_facets_get_term_name_from_id in Taxonomy Facets 7.3

Same name and namespace in other branches
  1. 7.2 taxonomy_facets.module \taxonomy_facets_get_term_name_from_id()

Get term name using term id.

Parameters

integer $tid: Term id.

File

./taxonomy_facets.module, line 384

Code

function taxonomy_facets_get_term_name_from_id($tid) {
  $result = db_query('SELECT vid, name FROM {taxonomy_term_data} WHERE tid = :tid', array(
    'tid' => $tid,
  ));
  $term = array();
  foreach ($result as $record) {
    $term['name'] = filter_xss($record->name);
    $term['vid'] = $record->vid;
  }
  return $term;
}