FacetWP – trick FacetWP into supporting multiple data sources

mgibbs189

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

// we have 3 facets: my_autcomplete, my_autocomplete_2, my_autocomplete_3
// trick FacetWP into using _2 and _3’s values for the first facet
function my_facetwp_index_row( $params, $class ) {
$name = $params[‘facet_name’];
if ( ‘my_autocomplete_2’ == $name || ‘my_autocomplete_3’ == $name ) {
$params[‘facet_name’] = ‘my_autocomplete’;
}
return $params;
}

add_filter( ‘facetwp_index_row’, ‘my_facetwp_index_row’, 10, 2 );
{{/gist}}