【发布时间】:2015-06-29 19:32:01
【问题描述】:
$terms = array('Audio','CD','Download','DVD','Publication','Website');
foreach( $terms as $term ) {
//intert the term
wp_insert_term(
$term, // the term
'media-type' // the taxonomy
);
}
如果可能的话,我还希望这些条款成为唯一的条款,并阻止用户添加更多条款。
谢谢。
【问题讨论】:
-
你上面的代码有什么问题?
标签: php wordpress foreach custom-taxonomy