bp_blogs_update_meta_cache

Slurp up blogmeta for a specified set of blogs.

Description

bp_blogs_update_meta_cache( (bool) $blog_ids = false ); 

It grabs all blogmeta associated with all of the blogs passed in $blog_ids and adds it to the WP cache. This improves efficiency when using querying blogmeta inline.

Parameters (1)

0. $blog_ids — Optional. (bool) => false
Accepts a single blog ID, or a comma- separated list or array of blog IDs.

Usage

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

Defined (1)

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

/bp-blogs/bp-blogs-cache.php  
  1. function bp_blogs_update_meta_cache( $blog_ids = false ) { 
  2. $cache_args = array( 
  3. 'object_ids' => $blog_ids,  
  4. 'object_type' =>buddypress)->blogs->id,  
  5. 'object_column' => 'blog_id',  
  6. 'cache_group' => 'blog_meta',  
  7. 'meta_table' =>buddypress)->blogs->table_name_blogmeta,  
  8. ); 
  9.  
  10. bp_update_meta_cache( $cache_args );