Created
February 23, 2017 01:24
-
-
Save bodiequirk/cd95811f1ea8f7d4df9572892ae7b3e5 to your computer and use it in GitHub Desktop.
Showing my custom functions with FacetWP Code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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