Created
September 1, 2016 11:36
-
-
Save mgibbs189/5de84654467c53c257435cc76f95d512 to your computer and use it in GitHub Desktop.
FacetWP - trick FacetWP into supporting multiple data sources
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 | |
// 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 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks a zillion for this one! :-)