facetwp_index_row

mgibbs189

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

// Set the facet’s Data source to “Post Type” as a placeholder

add_filter( ‘facetwp_index_row’, function( $params, $class ) {
if ( ‘is_beer_on_tap’ == $params[‘facet_name’] ) {
if ( is_beer_available( $params[‘post_id’] ) ) {
$params[‘facet_value’] = ‘on-tap’;
$params[‘facet_display_value’] = ‘On tap’;
}
return false; // don’t index anything else
}
return $params;
}, 10, 2 );

{{/gist}}