cptui_get_post_type_exists

Checks if a post type is already registered.

Description

cptui_get_post_type_exists( (string) $slug = '', (array) $data = array() ); 

Parameters (2)

0. $slug — Optional. (string) => ''
Post type slug to check. Optional. Default empty string.
1. $data — Optional. (array) => array()
Post type data being utilized. Optional.

Usage

  1. if ( !function_exists( 'cptui_get_post_type_exists' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'custom-post-type-ui/inc/utility.php'; 
  3.  
  4. // Post type slug to check. Optional. Default empty string. 
  5. $slug = ''; 
  6.  
  7. // Post type data being utilized. Optional. 
  8. $data = array(); 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = cptui_get_post_type_exists($slug, $data); 
  12.  

Defined (1)

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

/inc/utility.php  
  1. function cptui_get_post_type_exists( $slug = '', $data = array() ) { 
  2.  
  3. /** 
  4. * Filters the boolean value for if a post type exists for 3rd parties. 
  5. * @since 1.3.0 
  6. * @param string $slug Post type slug to check. 
  7. * @param array|string $data Post type data being utilized. 
  8. */ 
  9. return apply_filters( 'cptui_get_post_type_exists', post_type_exists( $slug ), $data );