Support

Account

Home Forums Front-end Issues Update to 5.11 cloned repeater field returns empty array Reply To: Update to 5.11 cloned repeater field returns empty array

  • Sure, have condensed:

    $disclaimers = get_field(‘disclaimers’);

    
    if( !empty($disclaimers) ) {
    		foreach( $disclaimers as $disclaimer ) {
    		$disclaim_type = $disclaimer['disclaimer'];
    		
    		#then looping through to generate a string
    		}
    }
    

    This get_field gives an empty array as above in first post. So the foreach loop fails.

    If I do like this I can see the data as expected:

    
    if( have_rows('disclaimers') ) {
    		while( have_rows('disclaimers') ) {
    			the_row();
    			// vars
    			$disclaimer = get_sub_field('disclaimer');
    			print_r($disclaimer);
    					
    		}
    }
    

    I rolled back to version 5.10.2 and the first foreach snippet worked again.