Why does wp_remove_object_terms not work?

by Eckstein   Last Updated April 01, 2018 06:08 AM

Why does this work to remove a single term?

$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');

But this doesn't?:

wp_remove_object_terms($postID, 'remove_this_terms', 'custom_taxonomy');

Am I misunderstanding what wp_remove_object_terms does?



Related Questions