cptui_get_post_type_exists

Filters the boolean value for if a post type exists for 3rd parties.

Description

apply_filters( 'cptui_get_post_type_exists', (string) $post_type_exists, (array|string) $data ); 

Parameters (2)

0. $post_type_exists (string) => post_type_exists( $slug )
Post type slug to check.
1. $data (array|string)
Post type data being utilized.

Usage

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

Defined (1)

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

/inc/utility.php  
  1. return apply_filters( 'cptui_get_post_type_exists', post_type_exists( $slug ), $data );