Load taxonomy term object by name or tid. Also how to get term parents from top to bottom.
Source code viewer
- // Case-insensitive and trimmed mapping for getting taxonomy term object by term name. In Drupal 5, 6, 7.
- taxonomy_get_term_by_name($name, $vocabulary = NULL);
- // Return the term object matching a term ID. In Drupal 7+.
- // Get term parents from top to bottom.
- $terms = taxonomy_get_parents_all($tid);
- $terms = array_reverse($terms);Programming Language: PHP