开发者

Drupal6 - Getting term id from term name

开发者 https://www.devze.com 2023-02-18 21:04 出处:网络
Hi Suppose I开发者_StackOverflow have a term name called \"product\" and the term id is \"123\", how can I use the term name \"product\" to get the term id \"123\"?

Hi

Suppose I开发者_StackOverflow have a term name called "product" and the term id is "123", how can I use the term name "product" to get the term id "123"?

Thanks


$get_term = taxonomy_get_term_by_name('product');

$term_id = $get_term[0]->tid;

This should work for you.


use this function

taxonomy_get_tid_by_name('product')

return value is array .

0

精彩评论

暂无评论...
验证码 换一张
取 消