Support

Account

Home Forums Front-end Issues radio button checked but no value Reply To: radio button checked but no value

  • You’re importer is probably not ACF aware and is probably not creating the needed ACF field key reference. If you’re importer has an ACF add on then you’ll need to use it. If not I would suggest http://www.wpallimport.com/, the pro version has an ACF add on that will do it correctly. Without the field key reference ACF does not know how to treat your field and that’s why nothing is returned.

    Radio fields store a single value, checkboxes store and array of values. You can’t swap out one for the other without adding checks to your template code to see if you’re getting an array or a single value.

    Returning value OR array also returns a single value for a radio field. In the case of a checkbox it returns an array of values. When you return both then a radio field will return an array containing both and a checkbox field will return an array of arrays (nested arrays). Again, you can’t just swap out one thing for the other without making code changes to deal with the values returned. For more information look at the documentation for each of these field types and how to deal with each of the return values.