Home › Forums › Front-end Issues › Get User Sub-Field Select Options › Reply To: Get User Sub-Field Select Options
I’m so sorry for not replying sooner; somehow I overlooked your response.
Are you trying to get the choice of the select field?
Or all of the choices that have been selected?
Neither, I am trying to get all of the available options for a select element.
For instance, let’s say I have the following select element:
<select name="my-select">
<option value="first-option">First Option</option>
<option value="second-option">Second Option</option>
<option value="third-option">Third Option</option>
<option value="fourth-option">Fourth Option</option>
<option value="fifth-option">Fifth Option</option>
</select>
I want to be able to query ACF somehow to get an array that might look something like:
array(
'first-option' => 'First Option',
'second-option' => 'Second Option',
'third-option' => 'Third Option',
'fourth-option' => 'Fourth Option',
'fifth-option' => 'Fifth Option',
);
Thanks.
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.