Last active
August 25, 2020 16:01
-
-
Save djrmom/3060010fdd356cfc331de9b87534933d to your computer and use it in GitHub Desktop.
facetwp fselect only parent terms
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php add_filter( 'facetwp_index_row', function( $params, $class ) { | |
if ( 'my_facet' == $params['facet_name'] ) { // change my_facet | |
if ( !empty( $params['parent_id'] ) ) { | |
$params['facet_value'] = ''; // skip indexing | |
} | |
} | |
return $params; | |
}, 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment