bb_get_topicmeta

Topic meta.

Description

bb_get_topicmeta( $topic_id, $meta_key ); 

Parameters (2)

0. $topic_id
The topic id.
1. $meta_key
The meta key.

Usage

  1. if ( !function_exists( 'bb_get_topicmeta' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-forums/bbpress/bb-includes/functions.bb-meta.php'; 
  3.  
  4. // The topic id. 
  5. $topic_id = null; 
  6.  
  7. // The meta key. 
  8. $meta_key = null; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = bb_get_topicmeta($topic_id, $meta_key); 
  12.  

Defined (1)

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

/bp-forums/bbpress/bb-includes/functions.bb-meta.php  
  1. function bb_get_topicmeta( $topic_id, $meta_key ) 
  2. if ( !$topic = get_topic( $topic_id ) ) { 
  3. return; 
  4.  
  5. $meta_key = bb_sanitize_meta_key( $meta_key ); 
  6. if ( !isset($topic->$meta_key) ) { 
  7. return; 
  8. return $topic->$meta_key;