FacetWP – index boolean value

mgibbs189

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

function index_is_featured( $params, $class ) {
if ( ‘is_featured’ == $params[‘facet_name’] ) { // the facet is named “is_featured”
$value = (int) $params[‘facet_value’];
$display_value = ( 0 == $value ) ? ‘Featured’ : ‘Not Featured’; // change the labels if needed
$params[‘facet_display_value’] = $display_value;
}
return $params;
}
add_filter( ‘facetwp_index_row’, ‘index_is_featured’, 10, 2 );
{{/gist}}