Home › Forums › Add-ons › Repeater Field › Call LABELS of selection field inside repeater › Reply To: Call LABELS of selection field inside repeater
I figured out the solution. I was to use array_column which helped me focus on that single column of information.
<?php if( get_field('degrees') ) {
while ( have_rows('degrees') ) : the_row();
$array[] = get_sub_field('degree_select');
endwhile;
$foo = implode(', ', array_column($array, 'label'));
echo $foo;
}
?>
You can learn more about those here:
https://www.php.net/manual/en/function.array-column.php
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.