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:

Description

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