为什么要删除单个术语?
$existingTerms = wp_get_post_terms($postID, \'custom_taxonomy\');
$newTerms = array();
foreach($existingTerms as $term) {
if ($term->slug != \'remove_this_term\') {
$newTerms[] = $term->term_id;
}
}
wp_set_post_terms($postID, $newTerms, \'custom_taxonomy\');
但这不是吗
wp_remove_object_terms($postID, \'remove_this_term\', \'custom_taxonomy\');
我误解了什么
wp_remove_object_terms 做