我正在尝试使用插入自定义分类法wp_insert_post()
以及tax_input
争论,但它不起作用。我想设置一个自定义分类(“类型”)和一个类别(“汽车”)的帖子
$new_post = array(
\'post_title\' => $title,
\'post_content\' => $description,
\'tax_input\' => array(\'types\' => array(\'cars\')),
\'post_status\' => \'pending\',
\'post_type\' => \'vehicles\'
);