Support

Account

Home Forums Backend Issues (wp-admin) Update field taxonomy Reply To: Update field taxonomy

  • hi @signelazer

    If you’re setting it on a custom post type, you’ll need to use this function wp_set_object_terms instead. https://wordpress.stackexchange.com/questions/114576/wp-set-post-terms-not-work

    Also, term_exists sends back the ID, so you don’t need to do $term_id->term_id, just $term_id would work as found here: https://codex.wordpress.org/Function_Reference/term_exists

    I found this by searching “wp_set_post_terms not working” and it was in the top 3 links (at least for my results). When trying to debug a situation, try searching for what’s wrong and you’ll find that usually a lot of other people have struggled with the same issue.

    Here’s some a resource (provided by ACF) for debugging: https://www.advancedcustomfields.com/resources/debug/

    Let us know if this helps or if the problem persists!

    Phil