Support

Account

Home Forums Add-ons Repeater Field Sort repeater fields by radio button subfield Reply To: Sort repeater fields by radio button subfield

  • Thanks to the suggestion bij Deej on this thread I managed to work this out.

    $repeater = get_field('recensie');
    foreach ($repeater as $key => $row) {
    	$recensent[$key] = $row['recensent'];
    	$recensent_functie[$key] = $row['recensent_functie'];
    	$recensent_link[$key] = $row['recensent_linkedin'];
    	$recensent_foto[$key] = $row['recensent_foto'];
    	$recensent_tekst[$key] = $row['recensie_tekst'];
    	$recensie_type[$key] = $row['recensie_type'];
    }
    array_multisort($recensie_type, SORT_ASC, $repeater);
    foreach( $repeater as $row ) { 
    
    	// styling for each field
    
    } ?>