Created
September 24, 2019 11:45
Star
You must be signed in to star a gist
Combine two facets' data source into one facet
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 | |
/** | |
* 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