Leave a Reply

1 comment

  1. When you remove vote check for your condition, then if needed:

    1. fetch categories with wp_get_object_terms() (low level func, you can specify to fetch names or ids only since you don’t need full objects for this)
    2. modify array (remove category you don’t need, add the one you do)
    3. set categories with wp_set_post_categories() (it will overwrite all categories so those you remove from array will be gone)