You are here

function taxonomy_facets_get_term_name_from_id in Taxonomy Facets 7.2

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

Get term name using term id.

Parameters

integer $tid: Term id.

2 calls to taxonomy_facets_get_term_name_from_id()
taxonomy_facets_get_menu_tree in ./taxonomy_facets.module
Print out menu tree for each vocab selected to be taxo faceted filter.
_taxonomy_facets_get_selected_filters in ./taxonomy_facets.module
Utility function to get filters.

File

./taxonomy_facets.module, line 876
Taxo Faceted Navigation module code.

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