list_terms_exclusions
Filters the terms to exclude from the terms query.
Usage
add_filter( 'list_terms_exclusions', 'wp_kama_list_terms_exclusions_filter', 10, 3 );
/**
* Function for `list_terms_exclusions` filter-hook.
*
* @param string $exclusions `NOT IN` clause of the terms query.
* @param array $args An array of terms query arguments.
* @param string[] $taxonomies An array of taxonomy names.
*
* @return string
*/
function wp_kama_list_terms_exclusions_filter( $exclusions, $args, $taxonomies ){
// filter...
return $exclusions;
}
- $exclusions(string)
NOT INclause of the terms query.- $args(array)
- An array of terms query arguments.
- $taxonomies(string[])
- An array of taxonomy names.
Changelog
| Since 2.3.0 | Introduced. |
Where the hook is called
wp-includes/class-wp-term-query.php 531
$exclusions = apply_filters( 'list_terms_exclusions', $exclusions, $args, $taxonomies );