sprouter-nate
8/9/2019 - 1:50 PM

Facet Choice Exclusion: remove 'Lodging' and 'Resorts' from "Resort Categories"

add_filter( 'facetwp_index_row', function( $params, $class ) {
    if ( 'resort_categories' == $params['facet_name'] ) {
        $excluded_terms = array( 'lodging', 'resorts' );
        if ( in_array( $params['facet_value'], $excluded_terms ) ) {
            return false;
        }
    }
    return $params;
}, 10, 2 );

/* NOTES
 * 'facet_value' targets the raw value
 * 'facet_display_value' will target the displayed option
 https://facetwp.com/how-to-exclude-certain-categories/
 After implementing changes, clear site cache and re-index your Facets
*/