mgibbs189

{{gist file=”test.php” lang=”php”}}
<?php

function fwp_sortby_views( $options, $params ) {
$options[‘views’] = array(
‘label’ => ‘Most Views’,
‘query_args’ => array(
‘orderby’ => ‘post_views’,
)
);
return $options;
}
add_filter( ‘facetwp_sort_options’, ‘fwp_sortby_views’, 10, 2 );
{{/gist}}