我个人也有同样的需求wp_set_object_terms
在对所有自定义帖子类型执行WP\\U查询重新请求后。我想你可以代替my_custom_type
具有post
以下引用我的代码:
$my_query = array(
\'post_type\' => array( \'post\', \'my_custom_type\' ) );
$the_query = new WP_Query( $my_query );
while ( $the_query->have_posts() ) : $the_query->the_post();
$id = get_the_ID();
wp_set_object_terms( $id, "my_new_tag_value", "my_tax_slug", $append=true );
endwhile;