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
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.