Home › Forums › Add-ons › Repeater Field › Using repeater for look up not working › Reply To: Using repeater for look up not working
Kind of solved:
If I prevent the function from break-ing out of the loop once I’ve found the element I need the process works correctly.
If I break out at the point of finding the element I need the next time the function runs it continues where it left off in the previous loop and therefore misses repeated searches.
function get_column_content($columnId){
while(have_rows("adv_columns",get_the_ID())){
the_row();
if(get_sub_field('column_id')==$columnId){
$found= get_sub_field('content');
}
}
return $found;
}
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.