Changeset 7645 for trunk/bp-groups/bp-groups-cache.php
- Timestamp:
- 12/04/2013 02:07:20 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-groups/bp-groups-cache.php
r7183 r7645 15 15 16 16 /** 17 * Slurp s up groupmeta17 * Slurp up metadata for a set of groups. 18 18 * 19 19 * This function is called in two places in the BP_Groups_Group class: … … 21 21 * - in the get() method, when multiple groups are queried 22 22 * 23 * It grabs all groupmeta associated with all of the groups passed in $group_ids and adds it to 24 * the WP cache. This improves efficiency when using groupmeta inline 23 * It grabs all groupmeta associated with all of the groups passed in 24 * $group_ids and adds it to WP cache. This improves efficiency when using 25 * groupmeta within a loop context. 25 26 * 26 * @param int|str|array $group_ids Accepts a single group_id, or a comma-separated list or array of27 * group ids27 * @param int|str|array $group_ids Accepts a single group_id, or a 28 * comma-separated list or array of group ids. 28 29 */ 29 30 function bp_groups_update_meta_cache( $group_ids = false ) { … … 41 42 } 42 43 44 /** 45 * Clear the cached group count. 46 * 47 * @param $group_id Not used. 48 */ 43 49 function groups_clear_group_object_cache( $group_id ) { 44 50 wp_cache_delete( 'bp_total_group_count', 'bp' ); … … 51 57 52 58 /** 53 * Bust group caches when editing or deleting 59 * Bust group caches when editing or deleting. 54 60 * 55 * @since BuddyPress (1.7) 56 * @param int $group_id The group being edited 61 * @since BuddyPress (1.7.0) 62 * 63 * @param int $group_id The group being edited. 57 64 */ 58 65 function bp_groups_delete_group_cache( $group_id = 0 ) { … … 66 73 67 74 /** 68 * Clear s caches for the group creator when a group is created75 * Clear caches for the group creator when a group is created. 69 76 * 70 * @param int $group_id 71 * @param BP_Groups_Group $group_obj 72 * @since BuddyPress (1.6) 77 * @since BuddyPress (1.6.0) 78 * 79 * @param int $group_id ID of the group. 80 * @param BP_Groups_Group $group_obj Group object. 73 81 */ 74 82 function bp_groups_clear_group_creator_cache( $group_id, $group_obj ) { … … 81 89 * Clears caches for all members in a group when a group is deleted 82 90 * 83 * @param BP_Groups_Group $group_obj 84 * @param array User IDs who were in this group 85 * @since BuddyPress (1.6) 91 * @since BuddyPress (1.6.0) 92 * 93 * @param BP_Groups_Group $group_obj Group object. 94 * @param array User IDs who were in this group. 86 95 */ 87 96 function bp_groups_clear_group_members_caches( $group_obj, $user_ids ) { … … 92 101 add_action( 'bp_groups_delete_group', 'bp_groups_clear_group_members_caches', 10, 2 ); 93 102 103 /** 104 * Clear a user's cached group count. 105 * 106 * @param int $group_id ID of the group. Not used in this function. 107 * @param int $user_id ID of the user whose group count is being changed. 108 */ 94 109 function groups_clear_group_user_object_cache( $group_id, $user_id ) { 95 110 wp_cache_delete( 'bp_total_groups_for_user_' . $user_id, 'bp' );
Note: See TracChangeset
for help on using the changeset viewer.