taxonomy_get_synonyms

Definition

taxonomy_get_synonyms($tid)
modules/taxonomy.module, line 922

Description

Return an array of synonyms of the given term ID.

Code

<?php
function taxonomy_get_synonyms($tid) {
  if ($tid) {
    $result = db_query('SELECT name FROM {term_synonym} WHERE tid = %d', $tid);
    while ($synonym = db_fetch_array($result)) {
      $synonyms[] = $synonym['name'];
    }
    return $synonyms ? $synonyms : array();
  }
  else {
    return array();
  }
}
?>
 
 

Drupal is a registered trademark of Dries Buytaert.