Support

Account

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.