Home › Forums › General Issues › Editing a Radio Button Field Resets Choice to First Available
I’m doing some updates / enhancements to my ACF Pro fields. I have a radio button field that is currently actively being used by several pages on the site. I noticed that when I make an update to the radio button field by adding another choice, it seems to reset all of the fields on all of the pages that use it to the first available radio button choice.
Example:
Original choices:
file : PDF File
internal link : Button Link Internal
external link : Button Link External
New Choices:
file : PDF File
internal link : Button Link Internal
external link : Button Link External
blog link : Button Blog Post
A page that previously had the 2nd or 3rd choice selected now has the 1st choice selected (PDF File). Note, no data is lost, it’s just that we need to go though all the pages manually to reset the originally chosen option. Is there a way to avoid this in the future? Is there a setting I’m missing somewhere?
Please advise. Thank you very much.
Hi,
There isn’t really any “source” as I made these changes in the ACF GUI.
I was able to get this from the ACF backup I took of the custom field before I made the change:
{
"key": "field_5d1471e8f999d",
"label": "File or Link?",
"name": "file_or_link",
"type": "radio",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"choices": {
"file": "PDF File",
"internal link": "Button Link Internal",
"external link": "Button Link External"
},
"allow_null": 0,
"other_choice": 0,
"default_value": "",
"layout": "vertical",
"return_format": "value",
"save_other_choice": 0
},
And after I made the change:
{
"key": "field_5d1471e8f999d",
"label": "File or Link?",
"name": "file_or_link",
"type": "radio",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"choices": {
"file": "PDF File",
"internal link": "Button Link Internal",
"external link": "Button Link External",
"blog link": "Button Blog Post"
},
"allow_null": 0,
"other_choice": 0,
"default_value": "",
"layout": "vertical",
"return_format": "value",
"save_other_choice": 0
},
I would send screen shots but that doesn’t seem possible.
Thanks.
I created a radio button like your first, set a value on a post, then I altered the button as you have and I did not see any change to the selected value on the post.
I do not know what is causing this, but ACf seems to be functioning correctly.
It could be any number of things: another plugin, something in the theme, another field, a filter of some kind.
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!
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.