pll_get_post_types

Filter the list of post types available for translation.

Description

apply_filters( 'pll_get_post_types', (unknown) $post_types, (bool) $true ); 

Parameters (2)

0. $post_types (unknown)
The post types.
1. $true (bool) => true
The true.

Usage

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

Defined (2)

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

/settings/settings-cpt.php  
  1. $this->post_types = array_unique( apply_filters( 'pll_get_post_types', $post_types, true ) ); 
/include/model.php  
  1. $post_types = apply_filters( 'pll_get_post_types', $post_types, false );