list_terms_exclusions

Filters the terms to exclude from the terms query.

Description

apply_filters( 'list_terms_exclusions', (string) $exclusions, (array) $args, (array) $taxonomies ); 

Parameters (3)

0. $exclusions (string)
'NOT IN' clause of the terms query.
1. $args (array)
An array of terms query arguments.
2. $taxonomies (array)
An array of taxonomies.

Usage

To run the hook, copy the example below.
  1. $exclusions = apply_filters( 'list_terms_exclusions', $exclusions, $args, $taxonomies ); 
  2.  
  3. if ( !empty( $exclusions ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the list_terms_exclusions callback 
  2. function filter_list_terms_exclusions( $exclusions, $args, $taxonomies ) { 
  3. // make filter magic happen here... 
  4. return $exclusions
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'list_terms_exclusions', 'filter_list_terms_exclusions', 10, 3 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'list_terms_exclusions', 'filter_list_terms_exclusions', 10, 3 ); 

Defined (1)

The filter is defined in the following location(s).

/wp-includes/class-wp-term-query.php  
  1. $exclusions = apply_filters( 'list_terms_exclusions', $exclusions, $args, $taxonomies );