Home › Forums › Add-ons › Repeater Field › Repeater only outputting the last row › Reply To: Repeater only outputting the last row
I honestly don’t see anything “wrong” with your code in the first example. But I have had problems in the paste in load field filters when getting values from the same post that is being loaded. I just think that there are cases where calling ACF functions causes ACF to interfere with itself.
As a work-a-round you can try using get_post_meta to get the value, but I’m not sure that will work either.
// we need the post ID for get_post_meta
$post_id = $_GET['post']; // should have post id
$count = intval(get_post_meta($post_id, 'opposition_squad', true)); // holds $ rows in repeater
for (i=0; i<$count; i++) {
// foreach row of the repeater
$value = get_post_meta($post_id, 'opposition_squad_.'$i.'_opposition_player', true);
$choices[$value] = $value;
}
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.