Home › Forums › General Issues › Issues with for loop when switching from radio to checkbox › Reply To: Issues with for loop when switching from radio to checkbox
The old field returned a single value (string). Any posts that have not been updated will continue to return a single value. A radio field can only have one value.
Any post updated or added after the change will return an array of values. A checkbox field can hold multiple values.
You will need to check for both conditions and something different for each. Either that or you will need to edit every existing post to update the field so that it will always return an array.
I haven’t got a clue how to incorporate any of this into twig because I don’t use 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.