bp_messages_get_meta

Get a piece of message metadata.

Description

bp_messages_get_meta( (int) $message_id, (string) $meta_key = '', (bool) $single = true ); 

Parameters (3)

0. $message_id (int)
ID of the message to retrieve meta for.
1. $meta_key — Optional. (string) => ''
Meta key to retrieve. Default empty string.
2. $single — Optional. (bool) => true
Whether or not to fetch all or a single value.

Usage

  1. if ( !function_exists( 'bp_messages_get_meta' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-messages/bp-messages-functions.php'; 
  3.  
  4. // ID of the message to retrieve meta for. 
  5. $message_id = -1; 
  6.  
  7. // Meta key to retrieve. Default empty string. 
  8. $meta_key = ''; 
  9.  
  10. // Whether or not to fetch all or a single value. 
  11. $single = true; 
  12.  
  13. // NOTICE! Understand what this does before running. 
  14. $result = bp_messages_get_meta($message_id, $meta_key, $single); 
  15.  

Defined (1)

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

/bp-messages/bp-messages-functions.php  
  1. function bp_messages_get_meta( $message_id, $meta_key = '', $single = true ) { 
  2. $retval = get_metadata( 'message', $message_id, $meta_key, $single ); 
  3.  
  4. return $retval;