Index: src/wp-includes/functions.php
===================================================================
--- src/wp-includes/functions.php	(revision 37751)
+++ src/wp-includes/functions.php	(working copy)
@@ -3532,6 +3532,89 @@
 }
 
 /**
+ * Sorts a list of objects, based on one or more orderby arguments.
+ *
+ * @since 4.6.0
+ *
+ * @global array $_wp_list_sort
+ *
+ * @param array        $list     An array of objects to filter.
+ * @param string|array $orderby  Optional. Either the field name to order by or an array
+ *                               of multiple orderby fields as $orderby => $order.
+ * @param string       $order    Optional. Either 'ASC' or 'DESC'. Only used if $orderby
+ *                               is a string.
+ * @return array The sorted array.
+ */
+function wp_list_sort( $list, $orderby = array(), $order = 'ASC' ) {
+	if ( ! is_array( $list ) ) {
+		return array();
+	}
+
+	if ( empty( $orderby ) ) {
+		return $list;
+	}
+
+	if ( is_string( $orderby ) ) {
+		$orderby = array( $orderby => $order );
+	}
+
+	foreach ( $orderby as $field => $direction ) {
+		$orderby[ $field ] = 'DESC' === strtoupper( $direction ) ? 'DESC' : 'ASC';
+	}
+
+	$GLOBALS['_wp_list_sort'] = $orderby;
+
+	usort( $list, '_wp_list_sort_callback' );
+
+	unset( $GLOBALS['_wp_list_sort'] );
+
+	return $list;
+}
+
+/**
+ * Callback function to sort a list of objects by specific fields.
+ *
+ * @since 4.6.0
+ * @access private
+ *
+ * @see wp_list_sort()
+ *
+ * @global array $_wp_list_sort
+ *
+ * @param object|array $a One object to compare.
+ * @param object|array $b The other object to compare.
+ * @return int 0 if both objects equal. -1 if second object should come first, 1 otherwise.
+ */
+function _wp_list_sort_callback( $a, $b ) {
+	if ( ! isset( $GLOBALS['_wp_list_sort'] ) ) {
+		return 0;
+	}
+
+	$a = (array) $a;
+	$b = (array) $b;
+
+	foreach ( $GLOBALS['_wp_list_sort'] as $field => $direction ) {
+		if ( ! isset( $a[ $field ] ) || ! isset( $b[ $field ] ) ) {
+			continue;
+		}
+
+		if ( $a[ $field ] == $b[ $field ] ) {
+			continue;
+		}
+
+		$results = 'DESC' === $direction ? array( 1, -1 ) : array( -1, 1 );
+
+		if ( is_numeric( $a[ $field ] ) && is_numeric( $b[ $field ] ) ) {
+			return ( $a[ $field ] < $b[ $field ] ) ? $results[0] : $results[1];
+		}
+
+		return 0 > strcmp( $a[ $field ], $b[ $field ] ) ? $results[0] : $results[1];
+	}
+
+	return 0;
+}
+
+/**
  * Determines if Widgets library should be loaded.
  *
  * Checks to make sure that the widgets library hasn't already been loaded.
