pll_filtered_taxonomies

Filter the list of taxonomies not translatable but filtered by language.

Description

apply_filters( 'pll_filtered_taxonomies', (array) $taxonomies, (bool) $false ); 

Includes only the post format by default The filter must be added soon in the WordPress loading process: in a function hooked to *plugins_loaded* or directly in functions.php for themes.

Parameters (2)

0. $taxonomies (array)
List of taxonomy names
1. $false (bool) => false
True when displaying the list of custom taxonomies in Polylang settings

Usage

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

Defined (1)

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

/include/model.php  
  1. $taxonomies = apply_filters( 'pll_filtered_taxonomies', $taxonomies, false );