FacetWP – sort options to include multiple fields

mgibbs189

{{gist file=”functions.php” lang=”php”}}
<?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 );
{{/gist}}