Skip to content

Instantly share code, notes, and snippets.

@mgibbs189
Last active February 25, 2020 11:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mgibbs189/5cf539766c0cc37e0c75f2bb76b3b1f9 to your computer and use it in GitHub Desktop.
Save mgibbs189/5cf539766c0cc37e0c75f2bb76b3b1f9 to your computer and use it in GitHub Desktop.
FacetWP - prevent proximity from re-ordering "post__in"
<?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;
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment