Uses
Uses | Description |
---|---|
wp-includes/class-wp-list-util.php: WP_List_Util::__construct() | Constructor. |
Sorts a list of objects, based on one or more orderby arguments.
(array) (Required) An array of objects to sort.
(string|array) (Optional) Either the field name to order by or an array of multiple orderby fields as $orderby => $order.
Default value: array()
(string) (Optional) Either 'ASC' or 'DESC'. Only used if $orderby is a string.
Default value: 'ASC'
(bool) (Optional) Whether to preserve keys.
Default value: false
(array) The sorted array.
File: wp-includes/functions.php
function wp_list_sort( $list, $orderby = array(), $order = 'ASC', $preserve_keys = false ) { if ( ! is_array( $list ) ) { return array(); } $util = new WP_List_Util( $list ); return $util->sort( $orderby, $order, $preserve_keys ); }
Version | Description |
---|---|
4.7.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/wp_list_sort