Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
12/04/2013 02:07:20 AM (11 years ago)
Author:
boonebgorges
Message:

Improve documentation in the Groups component. See #5022

File:
1 edited

Legend:

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

    r7183 r7645  
    1515
    1616/**
    17  * Slurps up groupmeta
     17 * Slurp up metadata for a set of groups.
    1818 *
    1919 * This function is called in two places in the BP_Groups_Group class:
     
    2121 *   - in the get() method, when multiple groups are queried
    2222 *
    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.
    2526 *
    26  * @param int|str|array $group_ids Accepts a single group_id, or a comma-separated list or array of
    27  *    group ids
     27 * @param int|str|array $group_ids Accepts a single group_id, or a
     28 *        comma-separated list or array of group ids.
    2829 */
    2930function bp_groups_update_meta_cache( $group_ids = false ) {
     
    4142}
    4243
     44/**
     45 * Clear the cached group count.
     46 *
     47 * @param $group_id Not used.
     48 */
    4349function groups_clear_group_object_cache( $group_id ) {
    4450    wp_cache_delete( 'bp_total_group_count', 'bp' );
     
    5157
    5258/**
    53  * Bust group caches when editing or deleting
     59 * Bust group caches when editing or deleting.
    5460 *
    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.
    5764 */
    5865function bp_groups_delete_group_cache( $group_id = 0 ) {
     
    6673
    6774/**
    68  * Clears caches for the group creator when a group is created
     75 * Clear caches for the group creator when a group is created.
    6976 *
    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.
    7381 */
    7482function bp_groups_clear_group_creator_cache( $group_id, $group_obj ) {
     
    8189 * Clears caches for all members in a group when a group is deleted
    8290 *
    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.
    8695 */
    8796function bp_groups_clear_group_members_caches( $group_obj, $user_ids ) {
     
    92101add_action( 'bp_groups_delete_group', 'bp_groups_clear_group_members_caches', 10, 2 );
    93102
     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 */
    94109function groups_clear_group_user_object_cache( $group_id, $user_id ) {
    95110    wp_cache_delete( 'bp_total_groups_for_user_' . $user_id, 'bp' );
Note: See TracChangeset for help on using the changeset viewer.