Skip to content

Instantly share code, notes, and snippets.

@mgibbs189
Created September 1, 2016 11:36
Show Gist options
  • Save mgibbs189/5de84654467c53c257435cc76f95d512 to your computer and use it in GitHub Desktop.
Save mgibbs189/5de84654467c53c257435cc76f95d512 to your computer and use it in GitHub Desktop.
FacetWP - trick FacetWP into supporting multiple data sources
<?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 );
@1KDevelopment
Copy link

Thanks a zillion for this one! :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment