Support

Account

Home Forums General Issues Fill repeater field within a group

Solved

Fill repeater field within a group

  • Hello together!

    I have a group with the field ID: field_62a0868f8e5fd

    In this group I have different layouts. One layout has general fields and then 2 repeater fields (left and right).

    I fill the fields with add_row which works fine for the “normal fields”. But the two repeater fields can not be filled. Can someone help me?

    Attached is my code so far:

    add_row('field_62a0868f8e5fd',
                               array(
                                   'acf_fc_layout' => 'zweispalter',
                                   'field_62a300bcf4d43' => 1,
                                   'field_62a300eef4d45' => '1544',
                                   'field_637bd0ff02baa' => 0,
                                   'field_62a30147f4d47' => 'none',
                                   'field_62a3015bf4d48' => 'big',
                                   'field_62a302cf624f5' => array(
                                       'field_62a30344883bc' => 0,
                                       'field_62a30373883bd' => 'headline',
                                       'field_62a305c117c04' => $zweispalterHeadline,
                                       'field_62a3060717c05' => 'big'
                                   ),
                                   'field_62a3071366959' => array(
                                       'field_62a307146695b' => 0,
                                       'field_62a307146695c' => 'text',
                                       'field_62a3071466962' => $zweispalterText,
                                       'field_62a3071466963' => 'small'
                                   )
                               ),$post_id
                            );
  • What in your example represents the repeater field(s)?

  • There are 2 repeater fields in my example.
    The first repeater field is: field_62a302cf624f5
    and the second repeater field is: field_62a3071366959

  • A repeater field requires and nested array

    
    'field_62a302cf624f5' => array(
      // nested array for each row
      array(
        // array of field key => value pairs
      )
    ),
    
  • thanks. it works!

  • If I understand your question correctly, you want to display an Advanced Custom Fields (ACF) field if the current page is a child page of a specific parent page, called “Parent XYZ.”

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.