Skip to content

Instantly share code, notes, and snippets.

@djrmom
Created November 22, 2019 17:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save djrmom/7a18a9977fbcbd4045af56be2506492d to your computer and use it in GitHub Desktop.
Save djrmom/7a18a9977fbcbd4045af56be2506492d to your computer and use it in GitHub Desktop.
facetwp has term
<?php
add_filter( 'facetwp_index_row', function( $params, $class ) {
if ( 'my_facet_name' == $params['facet_name'] ) { // change my_facet_name to the name of your facet
$params['facet_value'] = "1";
$params['facet_display_value'] = 'Has Term'; // change Has Term to whatever you want for a label
}
return $params;
}, 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment