Skip to content

Instantly share code, notes, and snippets.

View gist:f5c1f185212cbd21de8d67145feda5f6
function index_top_level_terms( $params, $class ) {
if ( 'univers' == $params['facet_name'] ) {
if ( 0 < $params['depth'] ) {
return false; // don't index child terms
}
}
if ( 'familles' == $params['facet_name'] ) {
if (( 0 == $params['depth'] ) || ( 2 == $params['depth'] )) {
return false; // index level 2 terms