Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
嗨 假设我有一个名为“产品”的术语名称,并且术语 ID 是“123”,我如何使用术语名称“产品”来获取术语 ID“123”?
谢谢
$get_term = taxonomy_get_term_by_name('product'); $term_id = $get_term[0]->tid;
这应该适合你。
使用这个功能
taxonomy_get_tid_by_name('product')
返回值为数组。