Home › Forums › Backend Issues (wp-admin) › Need a solution for a single True/False Field to set a stored taxonomy term › Reply To: Need a solution for a single True/False Field to set a stored taxonomy term
I don’t have any code examples.
What you need to do is create an acf/save_post action. In this action you check the value of the true/false field. If it is true then you use wp_set_post_terms() to set the term.
You will also need to check to see if the value of the true/false field is false and if the term is set for the post (wp_get_post_terms()) and again use wp_set_post_terms() to remove it.
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.