MasterPress 1.3.1 is a compatibility release for PHP 8 and WordPress 5.7. It still remains backwards compatible with older PHP versions.
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.