Home › Forums › General Issues › Fill repeater field within a group
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!
You must be logged in to reply to this topic.
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!
Accordions are a great way to group related information while allowing users to interactively show and hide content. In this video, Damon Cook goes in-depth on how to create an accessible accordion block using ACF PRO’s Repeater field.https://t.co/RXT0g25akN— Advanced Custom Fields (@wp_acf) March 2, 2023
© 2023 Advanced Custom Fields.