Commit f8caf93b authored by Isaac Torres Michel's avatar Isaac Torres Michel Committed by Kenny Hall

Sorts options in ListCountry fields by name #3117 (#3137)

* Options in ListCountry field sorted by name #3117

* Fix to support legacy PHP env #3137
parent 68b977fc
...@@ -60,8 +60,15 @@ class NF_Fields_ListCountry extends NF_Abstracts_List ...@@ -60,8 +60,15 @@ class NF_Fields_ListCountry extends NF_Abstracts_List
$options[ $key ][ 'selected' ] = 1; $options[ $key ][ 'selected' ] = 1;
} }
return $options; usort( $options, array($this,'sort_options_by_label') );
}
return $options;
}
private function sort_options_by_label( $option_a, $option_b )
{
return strcasecmp( $option_a['label'], $option_b['label'] );
}
public function filter_options_preview( $field_settings ) public function filter_options_preview( $field_settings )
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment