Home › Forums › General Issues › Users select a single category only › Reply To: Users select a single category only
You’ve probably figured this out. The cause of this is that the plugin you mention changes the name of the field from post_category[]
to radio_tax_input[category][]
. ACF is not detecting the category because it can’t find the category field. Using this plugin you will need to save the changes to the post for the correct field groups to appear.
There may be a way to add to alter what ACF is submitting in the AJAX request in order to use the value set for this field. Unfortunately I’m not familiar enough with this to know if it can be done or not and it would probably take some extensive digging through the JS to figure it out.
Alternately you might be able to use a single field group with a taxonomy field that only allows one selection and to use conditional logic for the remaining field in the group.
Another possible solution is to not use the plugin your using and construct a custom callback for showing the category selection box that does not alter the name of the field used, unfortunately I’m not sure about this either. I would probably start by figuring out how the plugin that you’re using is defining the custom callback function and then use that in combination with my own meta box function that does not alter the field name. For a radio button you would just use post_category
instead of post_category[]
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.