Support

Account

Home Forums General Issues Unchek Taxonomy field programatically

Helping

Unchek Taxonomy field programatically

  • Hi,

    In my case i need to uncheck a taxonomy field (radio button) so i do this an it works, but i would like to know if it’s the good method.
    Thnaks

    if ($value=='561') 
    {
    $term_taxo_ids = wp_set_object_terms( $id, '', 'niveau_d_urgence');		update_post_meta($id  , 'urgence' ,'' ); 
    }
  • Yep, it’s not bad, you are removing all of your terms from that post. Maybe you should use wp_delete_object_term_relationships( $object_id, $taxonomies ); but your solution works too.

Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘Unchek Taxonomy field programatically’ is closed to new replies.