Added sorting of segments so that they have predictable order.

This commit is contained in:
Peter Fabian 2019-01-15 11:13:43 +01:00
parent ea2d5bfe35
commit d067c2148d
1 changed files with 3 additions and 1 deletions

View File

@ -584,7 +584,9 @@ class WC_Admin_Reports_Orders_Data_Store extends WC_Admin_Reports_Data_Store imp
}
// Using array_values to remove custom keys, so that it gets later converted to JSON as an array.
return array_values( $segments );
$segments_no_keys = array_values( $segments );
$this->sort_array( $segments_no_keys, 'segment_id', 'asc' );
return $segments_no_keys;
}
/**