bp_forums_get_topic_details

Get additional details about a given forum topic.

Description

(object) bp_forums_get_topic_details( (int) $topic_id ); 

Returns (object)

Details about the topic.

Parameters (1)

0. $topic_id (int)
ID of the topic for which you're fetching details.

Usage

  1. if ( !function_exists( 'bp_forums_get_topic_details' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-forums/bp-forums-functions.php'; 
  3.  
  4. // ID of the topic for which you're fetching details. 
  5. $topic_id = -1; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = bp_forums_get_topic_details($topic_id); 
  9.  

Defined (1)

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

/bp-forums/bp-forums-functions.php  
  1. function bp_forums_get_topic_details( $topic_id ) { 
  2.  
  3. /** This action is documented in bp-forums/bp-forums-screens.php */ 
  4.  
  5. $query = new BB_Query( 'topic', 'topic_id=' . $topic_id . '&page=1' /** Page override so bbPress doesn't use the URI */ ); 
  6.  
  7. return $query->results[0];