Home › Forums › General Issues › Disable Options for Select Field › Reply To: Disable Options for Select Field
Sorry, increasing the priority was a quick answer before I actually looked into the ACF code and posted my second answer.
Increasing the priority is my first step whenever I’m debugging some issue in ACF. Why? because ACF initializes the field on the same hook that you use. There are filters in ACF itself for acf/load_field...
and all of the ACF filters run with a priority of 10. ACF’s filters do not look any changes that may have already been made and loads the field with all default settings, meaning that if you’re filter runs before ACF’s filter that anything you change is ignored and replaced with the original values. Changing the priority to > 10 ensures that you filter runs only after ACF is done an eliminates that as a cause. When I tested your issue myself, this is the first thing I tried before looking at the ACF code.
At any rate, that is not the solution. There are other fields that do allow disabling of individual options. The checkbox and radio field have this ability by passing the array you have in the OP. More than likely it is an oversight that it is not also include for the select field, which is why I suggested contacting support.
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.