Taxonomy

By admin, 24 July, 2018

Drupal 7
เราใช้ ฟังชั่น taxonomy_term_load()

สำหรับ tid ตัวเดียว

<?php

$term = taxonomy_term_load($tid);
$name = $term->name;

?>

สำหรับ หรับ tid  หลายตัว

<?php

$tids = array(1, 2, 3);
$terms = taxonomy_term_load_multiple($tids);

foreach ($terms as $term) {
  $name = $term->name;
}

?>