Skip to content

Instantly share code, notes, and snippets.

@bodiequirk
Created February 23, 2017 01:24
Show Gist options
  • Save bodiequirk/cd95811f1ea8f7d4df9572892ae7b3e5 to your computer and use it in GitHub Desktop.
Save bodiequirk/cd95811f1ea8f7d4df9572892ae7b3e5 to your computer and use it in GitHub Desktop.
Showing my custom functions with FacetWP Code
<?php
// Enable FacetWP Locator
add_filter( 'facetwp_proximity_store_distance', '__return_true' );
$distance = facetwp_get_distance();
if ( false !== $distance ) {
echo round( $distance, 2 );
}
function mysite_radius_options( $options ) {
return array( 10, 25, 50, 100, 250 );
}
add_filter( 'facetwp_proximity_radius_options', 'mysite_radius_options' );
function fwp_proximity_specific_country( $options ) {
$options['componentRestrictions'] = array(
'country' => 'us',
);
return $options;
}
add_filter( 'facetwp_proximity_autocomplete_options', 'fwp_proximity_specific_country' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment