post_type_supports

Check a post type's support for a given feature.

Description

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

Parameters (2)

0. $post_type (string)
The post type being checked.
1. $feature (string)
The feature being checked.

Usage

  1. if ( !function_exists( 'post_type_supports' ) ) { 
  2. require_once ABSPATH . WPINC . '/post.php'; 
  3.  
  4. // The post type being checked. 
  5. $post_type = ''; 
  6.  
  7. // The feature being checked. 
  8. $feature = ''; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = post_type_supports($post_type, $feature); 
  12.  

Defined (1)

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

/wp-includes/post.php  
  1. function post_type_supports( $post_type, $feature ) { 
  2. global $_wp_post_type_features; 
  3.  
  4. return ( isset( $_wp_post_type_features[$post_type][$feature] ) );