I have a setup, as shown above, using tabs, repeater fields, and radio buttons, with the fields under each radio button only showing under conditional logic that the radio button required is selected.
If I remove content from these fields, such as a link to a youtube video, an image, link, etc, then switch radio buttons and change the type of content I’m using, then save – the original deleted content is still there. To be clear, if I switch, then switch back, it is gone, it is only when I add something new under another radio button AND save, that the original content (under another radio button) comes back.
As of right now, I have to delete the content, save. Change the radio button, add content, save, in order to keep things clean. I personally feel I should be able to delete the contents of various fields, under various radio buttons, and add content, save, and have things stay as I last saw them, before saving.
Is there an intended reason for this behavior? Is it a bug? Let me know!
This has been brought up in the past, this has always been the way ACF has worked and it is not considered a bug.
When you save a post with fields hidden by conditional logic these fields are not submitted. Since they are not submitted, they are not updated.
The only way to work around this is as you have mentioned. There are coding/filter options for doing this that people have posted on this forum in the past, but it’s been a while and I can’t find them.
Without doing this, when showing values on the front end you need to check the radio button to see what’s selected and then only show the fields that should be shown.
I personally find this feature useful. My clients are constantly changing their mind. If the values were deleted when they change, if they change back they’d need to enter the information again. With it working this way they can switch back and forth all they want and it saves them work.
That actually makes a lot of sense, deleting the values under other areas would be more annoying than the “issue” I mentioned. I think it seemed more of a bug to me, as I was moving from a setup without radio buttons and fully populated fields, to radio buttons, and needed to remove a lot. Now that its done, the way things work is more or less ideal.
Either way, I figured I’d bring it up just in case, and now I know – thanks for the clarification.
I’ve found myself puzzling at the exact same experience. While I understand this particular scenario may not actually be a “bug” for ACF to address I am still wondering how you moved forward and handled the situation since what you described (and similarly what I have also built) was catering to a specific need of content building in the WordPress CMS.
Is there a modified approach to this method? Or did you have to totally re-build this section?
Thank you, looking forward to your response if this message is not lost in the wind…
You must be logged in to reply to this topic.
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!