FacetWP – prevent proximity from re-ordering “post__in”

mgibbs189

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

// add to your (child) theme’s functions.php
// this unregisters the proximity facet’s “post ID re-sorting” hook

add_filter( ‘facetwp_query_args’, function( $query_args ) {
remove_filter( ‘facetwp_filtered_post_ids’, [ FWP()->helper->facet_types[‘proximity’], ‘sort_by_distance’ ] );
return $query_args;
} );

{{/gist}}