Support

Account

Home Forums Backend Issues (wp-admin) Pre-populate mulitiple Repeater rows Reply To: Pre-populate mulitiple Repeater rows

  • Thanks John,

    The empty $value returns bool(false).

    I currently use the following which seems to work:

    // Add pre-populated Repeater Fields
    function my_acf_load_value($value, $post_id, $field) {
      
      if ($value !== FALSE) {
        return $value;
      }
      $value = array(
        array(
          'field_5e8317693aa96' => 'Production',
        ),
        array(
          'field_5e8317693aa96' => 'Director',
        ),
        array(
          'field_5e8317693aa96' => 'Author',
        ),
        array(
          'field_5e8317693aa96' => 'Artist',
        ),
        array(
          'field_5e8317693aa96' => 'Etc'
        )
      );
      return $value;
    
    }
    add_filter('acf/load_value/name=team', 'my_acf_load_value', 1, 3);

    Thanks a bunch!