wp_list_sort ( $list, $orderby = array(), $order = 'ASC', $preserve_keys = false )

  • (array) 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.
  • (string) order Optional. Either 'ASC' or 'DESC'. Only used if $orderby is a string.
  • (bool) preserve_keys Optional. Whether to preserve keys. Default false.
  • (array) The sorted array.
Defined at:


Sorts an array of objects or arrays based on one or more orderby arguments.

Related Functions

wp_list_users, wp_list_cats, wp_list_authors, wp_playlist_shortcode, wp_list_pages

Top Google Results

User discussions

wpseek mobile