Skip to content

Instantly share code, notes, and snippets.

Created August 13, 2017 05:58
Show Gist options
  • Save anonymous/dd3db1610f060f6c05c600e7cef88c38 to your computer and use it in GitHub Desktop.
Save anonymous/dd3db1610f060f6c05c600e7cef88c38 to your computer and use it in GitHub Desktop.
add_filter( 'facetwp_query_args', function( $query_args, $class ) {
if ( 'ressources' == $class->ajax_params['template'] ) {
if ( 0 < count( $class->facets['distance']['selected_values'] ) ) {
// change the orderby
}
}
return $query_args;
}, 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment