FacetWP – index a single boolean value

mgibbs189

{{gist file=”functions.php” lang=”php”}}
<?php

add_filter( ‘facetwp_index_row’, function( $params, $class ) {
if ( ‘CHANGE_ME’ == $params[‘facet_name’] ) {
if ( ‘yes’ == $params[‘facet_value’] ) {
$params[‘facet_display_value’] = ‘Yes’; // only index the “Yes” value
}
return false; // don’t index
}
}, 10, 2 );

{{/gist}}