FacetWP – index WPJM geolocation when Data source = geolocation_lat

mgibbs189

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

function index_latlng( $params, $class ) {
if ( ‘jobs_location’ == $params[‘facet_name’] ) {
$params[‘facet_value’] = get_post_meta( $params[‘post_id’], ‘geolocation_lat’, true );
$params[‘facet_display_value’] = get_post_meta( $params[‘post_id’], ‘geolocation_long’, true );
}
return $params;
}
add_filter( ‘facetwp_index_row’, ‘index_latlng’, 10, 2 );
{{/gist}}