Created
November 21, 2022 22:49
-
-
Save tripflex/d0a9cc4e9b99db0121f8ed9e01473594 to your computer and use it in GitHub Desktop.
Hide child terms for specific taxonomy when using Search and Filtering (requires 1.1.29 or newer)
This file contains 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( 'search_and_filtering_get_taxonomy_data_options_include_child_terms', 'smyles_tax_child_terms', 10, 2 ); | |
function smyles_tax_child_terms( $args, $taxonomy ){ | |
if( $taxonomy === 'job_listing_category' ){ | |
return false; | |
} | |
return $args; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment