wp_list_sort
wp_list_sort ( $input_list, $orderby = array(), $order = 'ASC', $preserve_keys = false )
Parameters:- (array) input_list An array of objects or arrays to sort.
- (string|array) orderby Optional. Either the field name to order by or an array of multiple orderby fields as `$orderby => $order`. Default empty array.
- (string) order Optional. Either 'ASC' or 'DESC'. Only used if `$orderby` is a string. Default 'ASC'.
- (bool) preserve_keys Optional. Whether to preserve keys. Default false.
Returns:- (array) The sorted array.
Defined at: - Introduced in WordPress: 4.7.0
- Deprecated in WordPress: —
Description
Sorts an array of objects or arrays based on one or more orderby arguments.