Home › Forums › Add-ons › Repeater Field › category taxonomy in repeater not saving › Reply To: category taxonomy in repeater not saving
Load/Save terms will not work correctly with a taxonomy field in a repeater. The reason is that each works independently of the others. Each time the terms are saved to the post the previous terms are removed. Save and load terms cannot be used for repeater sub fields.
See https://developer.wordpress.org/reference/functions/wp_set_post_terms/, when ACF sets the post terms the $append argument is set to false.
In order to do this in a repeater you have to build your own save terms function using an acf/save_post action. In the action you need to loop over repeater and build an array of terms to add and then set the post terms yourself.
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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.