Support

Account

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;
    }