bp_messages_update_meta_cache

Slurp up metadata for a set of messages.

Description

bp_messages_update_meta_cache( (bool) $message_ids = false ); 

It grabs all message meta associated with all of the messages passed in $message_ids and adds it to WP cache. This improves efficiency when using message meta within a loop context.

Parameters (1)

0. $message_ids — Optional. (bool) => false
Accepts a single message_id, or a comma-separated list or array of message ids.

Usage

  1. if ( !function_exists( 'bp_messages_update_meta_cache' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-messages/bp-messages-cache.php'; 
  3.  
  4. // Accepts a single message_id, or a 
  5. // comma-separated list or array of message ids. 
  6. $message_ids = false; 
  7.  
  8. // NOTICE! Understand what this does before running. 
  9. $result = bp_messages_update_meta_cache($message_ids); 
  10.  

Defined (1)

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

/bp-messages/bp-messages-cache.php  
  1. function bp_messages_update_meta_cache( $message_ids = false ) { 
  2. 'object_ids' => $message_ids,  
  3. 'object_type' =>buddypress)->messages->id,  
  4. 'cache_group' => 'message_meta',  
  5. 'object_column' => 'message_id',  
  6. 'meta_table' =>buddypress)->messages->table_name_meta,  
  7. 'cache_key_prefix' => 'bp_messages_meta' 
  8. ) );