Support

Account

Home Forums Add-ons Repeater Field Repeater text field default values Reply To: Repeater text field default values

  • Got it working by removing the foreach and just spitting out the return value:

    add_filter('acf/load_value/key=field_599774ca9d074', 'ek_option_defaults', 10, 3);
      function ek_option_defaults($value, $post_id, $field) {
          if ($value === false) {
              $value = array(
                  array(
                      'field_59977c2759a56' => '24 hours ago',
                      'field_599841d665210' => '',
                  ),
                  array(
                      'field_59977c2759a56' => '3 days ago',
                      'field_599841d665210' => '',
                  ),
                  array(
                      'field_59977c2759a56' => '7 days ago',
                      'field_599841d665210' => '',
                  ),
                //etc
    
              );
          }
          return $value;
      }