Last active
June 15, 2020 16:00
-
-
Save mgibbs189/b1c06bfae188a785e7be56e364fe2978 to your computer and use it in GitHub Desktop.
FacetWP - sort options to include multiple fields
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_filter( 'facetwp_sort_options', function( $options, $params ) { | |
$options['points_desc'] = [ | |
'label' => 'Points (Highest)', | |
'query_args' => [ | |
'orderby' => [ 'date' => 'ASC', 'meta_value_num' => 'DESC' ], | |
'meta_key' => 'points' | |
] | |
]; | |
return $options; | |
}, 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment