cptui_get_post_types_for_taxonomies

Filters the results returned to display for available post types for taxonomy.

Description

apply_filters( 'cptui_get_post_types_for_taxonomies', (array) $get_post_types, (array) $args, (string) $output ); 

Parameters (3)

0. $get_post_types (array) => get_post_types( $args, $output )
Array of post type objects.
1. $args (array)
Array of arguments for the post type query.
2. $output (string)
The output type we want for the results.

Usage

To run the hook, copy the example below.
  1. $get_post_types = apply_filters( 'cptui_get_post_types_for_taxonomies', $get_post_types, $args, $output ); 
  2.  
  3. if ( !empty( $get_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 cptui_get_post_types_for_taxonomies callback 
  2. function filter_cptui_get_post_types_for_taxonomies( $get_post_types, $args, $output ) { 
  3. // make filter magic happen here... 
  4. return $get_post_types
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'cptui_get_post_types_for_taxonomies', 'filter_cptui_get_post_types_for_taxonomies', 10, 3 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'cptui_get_post_types_for_taxonomies', 'filter_cptui_get_post_types_for_taxonomies', 10, 3 ); 

Defined (1)

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

/inc/taxonomies.php  
  1. $post_types = apply_filters( 'cptui_get_post_types_for_taxonomies', get_post_types( $args, $output ), $args, $output );