Hi,
I have a field of type: “Radio Button” with many possible choices. I need the “Choices” automatically appear in alphabetical order in the post creation page. It’s possible? If possible, I will be very happy if you tell me how to do it.
(I’m sorry my bad English)
Thank you.
see https://www.advancedcustomfields.com/resources/acfload_field/
add_filter('acf/load_field/name=field-name', 'short_choices');
function sort_choices($field) {
asort($field['choices']);
return $field;
}
Perfect! It was exactly what I needed. Thank you John Huebner!
Only correcting for future users know when viewing this topic:
A typo ‘short_choices’ should be ‘sort_choices’
But the code worked perfect. Thank you again! Hugs.