Support

Account

Forum Replies Created

  • I think you should use ksort – it sorts the array by key.
    Also you can’t save it to the $field[‘choices’], because this function does it by pointers. Just do it like this:

    function sort_checkbox( $field ) {
    	ksort($field["choices"]);
    	return $field;   
    }
    
    add_filter('acf/load_field/key=field_5d4164d40898f', 'sort_checkbox');
Viewing 1 post (of 1 total)