Last active
December 17, 2015 02:48
-
-
Save flashvnn/5538183 to your computer and use it in GitHub Desktop.
Drupal get taxonomy by name
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static function GetTermNameByTid($tid) { | |
$parents = taxonomy_get_parents($tid); | |
$output = ''; | |
if ($parents) { | |
$term = taxonomy_term_load($tid); | |
$output = $term->name; | |
return $output; | |
} else { | |
return FALSE; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment