Last active
August 24, 2020 17:44
-
-
Save djrmom/7328ebb3d388089087fff483f2fc5b29 to your computer and use it in GitHub Desktop.
facetwp index category and its children
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 | |
| /** reindex after adding filter code */ | |
| add_filter( 'facetwp_index_row', function( $params, $class ) { | |
| if ( 'label_fr' == $params['facet_name'] ) { // change if needed | |
| if ( 183 != $params['term_id'] && 183 != $params['parent_id'] ) ) { | |
| $params['facet_value'] = ''; | |
| } | |
| } | |
| return $params; | |
| }, 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment