Created
January 9, 2019 22:31
-
-
Save kadimi/053db49647aab68861df06ed14d99577 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Add this code to your custom template event-results.php, after $data has been filled | |
$orderBy = 'goals'; | |
$order = 'ASC'; // Or DESC | |
uasort( $data, function( $a, $b ) use ( $orderBy, $order ) { | |
return $order === 'DESC' | |
? $a[ $orderBy ] < $b [ $orderBy ] | |
: $a[ $orderBy ] > $b [ $orderBy ] | |
; | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment