Skip to content

Instantly share code, notes, and snippets.

@mgibbs189
Created September 24, 2019 11:45
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save mgibbs189/47291bb2e3e13bbfeab3a74ac7f7eea5 to your computer and use it in GitHub Desktop.
Combine two facets' data source into one facet
<?php
/**
* This will trick FacetWP's indexer into indexing "tags_list" values for the "categories_new" facet
*
* Re-index after adding the following code into your (child) theme's functions.php
*/
add_filter( 'facetwp_index_row', function( $params, $class ) {
if ( 'tags_list' == $params['facet_name'] ) {
$params['facet_name'] = 'categories_new';
}
return $params;
}, 99, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment