Home › Forums › ACF PRO › Get next field value in foreach loop through field group › Reply To: Get next field value in foreach loop through field group
You are using acf_get_fields()
which is a function in ACF that gets the fields in a group. It is an internal ACF function that builds field groups. This function does not populate the field values.
To get he values in an array you would need to use get_fields()
then you would need to match up the values with the names
$fields = acf_get_fields('204');
$values = get_fields();
// some time later to get a value for a field
$value = $values[$field['name']];
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.