以下函数有问题,因为我将传入一个变量wp_insert_term
: wp_insert_term( $term, $taxonomy, $args = array() );
如果我这样做,它将不起作用:wp_insert_term( \'abc\', $taxonomy, $args );
代码如下:
function insert_city($term) {
echo $term;
if (!term_exists($term, "property-city")) {
$args = array(\'description\'=> \'There is Described Glasgow.\',\'slug\' => \'glasgow\',);
wp_insert_term(\'hellotesting\',\'property-city\',$args);
// $i = get_cat_id($title);
// return $i;