Home › Forums › Add-ons › Repeater Field › Display repeater subfield as a dropdown (label + value) › Reply To: Display repeater subfield as a dropdown (label + value)
If you are trying to create a select field that matches the choices of the field in questions then you don’t need to get every post and loop over them, so there shouldn’t be a need for the query, just use get_field_object()
using the field key
$field = get_field_object('field_XXXXXXX');
foreach ($field['choices'] as $value => $label) ..... etc
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.