Home › Forums › Bug Reports › get_row doesn't reset in a have_rows loop › Reply To: get_row doesn't reset in a have_rows loop
Hey sorry for the very late reply. I am still coming across this issue but it happens for me when I have a flexible field inside a repeater.
if (have_rows('tab_content')){
while(have_rows('tab_content')){
$tabContent[$i]['tab_name'] = get_sub_field('tab_name');
$tabContent[$i]['tab_description'] = get_sub_field('tab_description');
if(have_rows('content')){
while(have_rows('content')){
the_row();
$currentLayout = get_row_layout();
$tabData['row'] = get_row(true); // Information in this is cached
$tabData['content_columns'] = get_sub_field('content_columns'); // Works if I directly call it like this
$tabContent[$i]['tab_content_layouts'][] = Render('page-flex__'.$currentLayout.'.twig', $tabData);
}//end while
}//end if
$i++;
}//end while
}//end if
//Render main with $tabContent
$data['tab_content'] = $tabContent;
Render('page-section-layout.twig', $data)
I am using ACF Pro version 5.6.10
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!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.