Home › Forums › ACF PRO › Clear fields on save if radio button is set › Reply To: Clear fields on save if radio button is set
Well, it depends on what you consider undesirable. There are two things that you can do, one in the template and one in the admin.
In the template you can get the value of the radio field and then get the correct address field based on which is selected. This would be my preference since it requires the least amount of extra code.
In the admin you can create an acf/save_post action http://www.advancedcustomfields.com/resources/acfsave_post/ and in this function you can see what the value of the radio field is and then delete the contents of the other field.
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!
Plugin boilerplates can do some of the heavy lifting during initial development. We look at four options to speed up your plugin creation. https://t.co/ZtMsdBxAHw— Advanced Custom Fields (@wp_acf) June 5, 2023
© 2023 Advanced Custom Fields.