rcp_topic_is_premium

The Restrict Content Pro - bbPress rcp topic is premium function.

Description

rcp_topic_is_premium( (null) $topic_id = null ); 

Parameters (1)

0. $topic_id — Optional. (null) => null
The topic id.

Usage

  1. if ( !function_exists( 'rcp_topic_is_premium' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'restrict-content-pro-bbpress/includes/topic-functions.php'; 
  3.  
  4. // The topic id. 
  5. $topic_id = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = rcp_topic_is_premium($topic_id); 
  9.  

Defined (1)

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

/includes/topic-functions.php  
  1. function rcp_topic_is_premium( $topic_id = null ) { 
  2.  
  3. if ( is_null( $topic_id ) ) { 
  4.  
  5. $topic_id = bbp_get_topic_id(); 
  6.  
  7.  
  8. $ret = (bool) get_post_meta( $topic_id, '_is_topic_paid', true ); 
  9.  
  10. if( ! $ret ) { 
  11.  
  12. $ret = rcp_forum_is_premium( bbp_get_forum_id() ); 
  13.  
  14.  
  15. return $ret;