$collection_rows = get_field('collection_profiles'); if ($collection_rows) { function cmp($a, $b) { if ($a->collection_profile_note == $b->collection_profile_note) { return 0; } else { return $a->collection_profile_note < $b->collection_profile_note ? 1 : -1; } } uasort($collection_rows, 'cmp'); print_r($collection_rows); echo '

'.__('Profiles in Collection','roots').'

'; echo '