bb_get_postmeta

Post meta.

Description

bb_get_postmeta( $post_id, $meta_key ); 

Parameters (2)

0. $post_id
The post id.
1. $meta_key
The meta key.

Usage

  1. if ( !function_exists( 'bb_get_postmeta' ) ) { 
  2. require_once '/bp-forums/bbpress/bb-includes/functions.bb-meta.php'; 
  3.  
  4. // The post id. 
  5. $post_id = null; 
  6.  
  7. // The meta key. 
  8. $meta_key = null; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = bb_get_postmeta($post_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_postmeta( $post_id, $meta_key ) 
  2. if ( !$post = bb_get_post( $post_id ) ) { 
  3. return; 
  4.  
  5. $meta_key = bb_sanitize_meta_key( $meta_key ); 
  6. if ( !isset( $post->$meta_key ) ) { 
  7. return; 
  8. return $post->$meta_key;