T
T
TANK_IST2018-04-06 19:28:07
WordPress
TANK_IST, 2018-04-06 19:28:07

How to display all ACF field options on a page?

I want to display a list of custom field options on the page as in the admin panel.
5ac79d2678c5d199192989.png
But get_field_objectit only displays the selected record.
How to display such a list?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Igor Vorotnev, 2018-04-10
@TANK_IST

After getting the object, look at the 'choices' key:

$field = get_field_object('field_abc123456789');
$choices = $field['choices'];

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question