cptui_post_type_supports

Checks if a requested post type has a custom CPTUI feature supported.

Description

cptui_post_type_supports( (string) $post_type, (string) $feature ); 

Parameters (2)

0. $post_type (string)
Post type slug.
1. $feature (string)
Feature to check for.

Usage

  1. if ( !function_exists( 'cptui_post_type_supports' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'custom-post-type-ui/inc/utility.php'; 
  3.  
  4. // Post type slug. 
  5. $post_type = ''; 
  6.  
  7. // Feature to check for. 
  8. $feature = ''; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = cptui_post_type_supports($post_type, $feature); 
  12.  

Defined (1)

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

/inc/utility.php  
  1. function cptui_post_type_supports( $post_type, $feature ) { 
  2.  
  3. $object = cptui_get_cptui_post_type_object( $post_type ); 
  4.  
  5. if ( ! empty( $object ) ) { 
  6. if ( array_key_exists( $feature, $object ) && ! empty( $object[ $feature ] ) ) { 
  7. return true; 
  8.  
  9. return false; 
  10.  
  11. return false;