Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
12/08/2011 02:57:38 AM (13 years ago)
Author:
boonebgorges
Message:

Introduces automatic meta cache features.
Introduces bp_update_meta_cache(), for collecting all metadata associated with an object or with multiple objects in one fell swoop, and adding it to the WP cache for quicker access later
Introduces bp_groups_update_meta_cache(), for collecting groupmeta at the beginning of a group loop
Modifies the BP_Groups_Group object so that groupmeta is fetched in the populate() and get() methods
Fixes #3799

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-groups/bp-groups-functions.php

    r5454 r5460  
    4747    if ( !$group = wp_cache_get( $cache_key, 'bp' ) ) {
    4848        $group = new BP_Groups_Group( $group_id, true, $load_users );
    49         wp_cache_set( $cache_key, $group, 'bp' );
     49        wp_cache_set( $cache_key, $group, 'bp' );   
    5050    }
    5151
     
    919919        $meta_key = preg_replace( '|[^a-z0-9_]|i', '', $meta_key );
    920920
    921         $metas = wp_cache_get( 'bp_groups_groupmeta_' . $group_id . '_' . $meta_key, 'bp' );       
     921        $metas = wp_cache_get( 'bp_groups_groupmeta_' . $group_id . '_' . $meta_key, 'bp' );
    922922        if ( false === $metas ) {
    923923            $metas = $wpdb->get_col( $wpdb->prepare("SELECT meta_value FROM " . $bp->groups->table_name_groupmeta . " WHERE group_id = %d AND meta_key = %s", $group_id, $meta_key) );
Note: See TracChangeset for help on using the changeset viewer.