bb_get_post_meta

The BuddyPress bb get post meta function.

Description

bb_get_post_meta( $key, (int) $post_id = 0 ); 

Parameters (2)

0. $key
The key.
1. $post_id — Optional. (int)
The post id.

Usage

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

Defined (1)

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

/bp-forums/bbpress/bb-includes/functions.bb-template.php  
  1. function bb_get_post_meta( $key, $post_id = 0 ) { 
  2. $bb_post = bb_get_post( get_post_id( $post_id ) ); 
  3. if ( isset($bb_post->$key) ) 
  4. return $bb_post->$key;