bp_activity_update_meta_cache

Slurp up activitymeta for a specified set of activity items.

Description

bp_activity_update_meta_cache( (bool) $activity_ids = false ); 

It grabs all activitymeta associated with all of the activity items passed in $activity_ids and adds it to the WP cache. This improves efficiency when using querying activitymeta inline.

Parameters (1)

0. $activity_ids — Optional. (bool) => false
Accepts a single activity ID, or a comma- separated list or array of activity ids.

Usage

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

Defined (1)

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

/bp-activity/bp-activity-cache.php  
  1. function bp_activity_update_meta_cache( $activity_ids = false ) { 
  2. $bp =buddypress); 
  3.  
  4. $cache_args = array( 
  5. 'object_ids' => $activity_ids,  
  6. 'object_type' => $bp->activity->id,  
  7. 'object_column' => 'activity_id',  
  8. 'cache_group' => 'activity_meta',  
  9. 'meta_table' => $bp->activity->table_name_meta,  
  10. 'cache_key_prefix' => 'bp_activity_meta' 
  11. ); 
  12.  
  13. bp_update_meta_cache( $cache_args );