It was brought to our attention that MasterPress would give a tonne of warnings and deprecation notices when used with PHP 7.4 – this update addresses those.
WOOF_Collection :: sort_to( String $field, Array $values, String $order = ASC, Boolean $clone = false )
Returns a collection of the items in this collection sorted by the given field in the order of a supplied values map. This is a difficult concept to explain, so please refer to the example!
The name of the field to retrieve the property to sort by
The values to sort to (see the example which illustrates this better).
String $order = ASC
The order of the sort, either “ASC” for (ascending), or “DESC” (descending)
Boolean $clone = false
If true, the original collection will be untouched, and a clone of the sorted collection will be returned instead.