get_<adjacent>_post_excluded_terms

Filters the IDs of terms excluded from adjacent post queries.

Description

apply_filters( 'get_<adjacent>_post_excluded_terms', (string) $excluded_terms ); 

The dynamic portion(s) of the hook name refer to the type of adjacency, next or previous..

Parameters (1)

0. $excluded_terms (string)
Array of excluded term IDs.

Usage

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

Defined (1)

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

/wp-includes/link-template.php  
  1. $excluded_terms = apply_filters( "get_{$adjacent}_post_excluded_terms", $excluded_terms );