bbp_is_custom_post_type

Check if the current post type is one of bbPress's.

Description

bbp_is_custom_post_type( (bool) $the_post = false ); 

Parameters (1)

0. $the_post — Optional. (bool) => false
Post object or post ID.

Usage

  1. if ( !function_exists( 'bbp_is_custom_post_type' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'bbpress/includes/common/template.php'; 
  3.  
  4. // Optional. Post object or post ID. 
  5. $the_post = false; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = bbp_is_custom_post_type($the_post); 
  9.  

Defined (1)

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

/includes/common/template.php  
  1. function bbp_is_custom_post_type( $the_post = false ) { 
  2.  
  3. // Assume false 
  4. $retval = false; 
  5.  
  6. // Viewing one of the bbPress post types 
  7. if ( in_array( get_post_type( $the_post ), array( 
  8. ) ) ) 
  9. $retval = true; 
  10.  
  11. return (bool) apply_filters( 'bbp_is_custom_post_type', $retval, $the_post );