buddypress/bp-activity/bp-activity-cache.php
r-a-y 798f8c4e89 EOF:
* Fall in line with WordPress 3.4 coding practices by removing all EOF closing PHP tags.

* Fixes #4443.

git-svn-id: https://buddypress.svn.wordpress.org/trunk@6342 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
2012-09-18 18:03:00 +00:00

37 lines
1.1 KiB
PHP

<?php
/**
* Functions related to the BuddyPress Activity component and the WP Cache
*
* @since BuddyPress (1.6)
*/
// Exit if accessed directly
if ( !defined( 'ABSPATH' ) ) exit;
/**
* Slurps up activitymeta
*
* This function is called in two places in the BP_Groups_Group class:
* - in the populate() method, when single group objects are populated
* - in the get() method, when multiple groups are queried
*
* It grabs all groupmeta associated with all of the groups passed in $group_ids and adds it to
* the WP cache. This improves efficiency when using groupmeta inline
*
* @param int|str|array $group_ids Accepts a single group_id, or a comma-separated list or array of
* group ids
*/
function bp_activity_update_meta_cache( $activity_ids = false ) {
global $bp;
$cache_args = array(
'object_ids' => $activity_ids,
'object_type' => $bp->activity->id,
'object_column' => 'activity_id',
'meta_table' => $bp->activity->table_name_meta,
'cache_key_prefix' => 'bp_activity_meta'
);
bp_update_meta_cache( $cache_args );
}