[ Index ]

PHP Cross Reference of BuddyPress

title

Body

[close]

/src/bp-groups/ -> bp-groups-cache.php (summary)

BuddyPress Groups Caching. Caching functions handle the clearing of cached objects and pages on specific actions throughout BuddyPress.

File Size: 396 lines (15 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 21 functions

  bp_groups_update_meta_cache()
  groups_clear_group_object_cache()
  bp_groups_delete_group_cache()
  bp_groups_delete_group_cache_on_metadata_change()
  bp_groups_clear_group_creator_cache()
  bp_groups_clear_group_members_caches()
  bp_groups_clear_invite_count_for_user()
  bp_groups_clear_invite_count_on_uninvite()
  bp_groups_clear_invite_count_on_send()
  groups_clear_group_user_object_cache()
  groups_clear_group_administrator_cache()
  groups_clear_group_administrator_cache_on_member_save()
  bp_groups_clear_group_administrator_cache_on_member_delete()
  groups_clear_group_type_cache()
  bp_groups_clear_user_group_cache_on_membership_save()
  bp_groups_clear_user_group_cache_on_invitation_save()
  bp_groups_clear_user_group_cache_on_invitation_change()
  bp_groups_clear_user_group_cache_on_other_events()
  bp_groups_reset_cache_incrementor()
  bp_groups_reset_cache_incrementor_on_group_term_change()
  bp_groups_reset_cache_incrementor_on_group_term_remove()

Functions
Functions that are not part of a class:

bp_groups_update_meta_cache( $group_ids = false )   X-Ref
Slurp up metadata for a set of groups.

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 WP cache. This improves efficiency when using
groupmeta within a loop context.

since: 1.6.0
param: int|string|array|bool $group_ids Accepts a single group_id, or a

groups_clear_group_object_cache( $group_id )   X-Ref
Clear the cached group count.

since: 1.0.0
param: int $group_id Not used.

bp_groups_delete_group_cache( $group_id = 0 )   X-Ref
Bust group caches when editing or deleting.

since: 1.7.0
param: int $group_id The group being edited.

bp_groups_delete_group_cache_on_metadata_change( $meta_id, $group_id )   X-Ref
Bust group cache when modifying metadata.

since: 2.0.0
param: int $meta_id Meta ID.
param: int $group_id Group ID.

bp_groups_clear_group_creator_cache( $group_id, $group_obj )   X-Ref
Clear caches for the group creator when a group is created.

since: 1.6.0
param: int             $group_id  ID of the group.
param: BP_Groups_Group $group_obj Group object.

bp_groups_clear_group_members_caches( $group_obj, $user_ids )   X-Ref
Clears caches for all members in a group when a group is deleted.

since: 1.6.0
param: BP_Groups_Group $group_obj Group object.
param: array           $user_ids  User IDs who were in this group.

bp_groups_clear_invite_count_for_user( $user_id )   X-Ref
Clear a user's cached total group invite count.

Count is cleared when an invite is accepted, rejected or deleted.

since: 2.0.0
param: int $user_id The user ID.

bp_groups_clear_invite_count_on_uninvite( $group_id, $user_id )   X-Ref
Clear a user's cached total group invite count when a user is uninvited.

Groan. Our API functions are not consistent.

since: 2.0.0
param: int $group_id The group ID. Not used in this function.
param: int $user_id  The user ID.

bp_groups_clear_invite_count_on_send( $group_id, $invited_users )   X-Ref
Clear a user's cached total group invite count when a new invite is sent.

since: 2.0.0
param: int   $group_id      The group ID. Not used in this function.
param: array $invited_users Array of invited user IDs.

groups_clear_group_user_object_cache( $group_id, $user_id )   X-Ref
Clear a user's cached group count.

since: 1.2.0
param: int $group_id The group ID. Not used in this function.
param: int $user_id  The user ID.

groups_clear_group_administrator_cache( $group_id )   X-Ref
Clear group administrator and moderator cache.

since: 2.1.0
param: int $group_id The group ID.

groups_clear_group_administrator_cache_on_member_save( BP_Groups_Member $member )   X-Ref
Clear group administrator and moderator cache when a group member is saved.

This accounts for situations where group admins or mods are added manually
using {@link BP_Groups_Member::save()}.  Usually via a plugin.

since: 2.1.0
param: BP_Groups_Member $member Member object.

bp_groups_clear_group_administrator_cache_on_member_delete( $user_id, $group_id )   X-Ref
Clear group administrator and moderator cache when a group member is deleted.

since: 4.0.0
param: int $user_id  User ID.
param: int $group_id Group ID.

groups_clear_group_type_cache( $group_id = 0 )   X-Ref
Clear the group type cache for a group.

Called when group is deleted.

since: 2.6.0
param: int $group_id The group ID.

bp_groups_clear_user_group_cache_on_membership_save( BP_Groups_Member $member )   X-Ref
Clear caches on membership save.

since: 2.6.0
param: BP_Groups_Member $member BP Groups Member instance.

bp_groups_clear_user_group_cache_on_invitation_save( BP_Invitation $invitation )   X-Ref
Clear caches on saving a group invitation or request.
The save action is called when inserting a new record or using the save() method
to update an existing record.

since: 5.0.0
param: BP_Invitation object $invitation Characteristics of the invitation just saved.

bp_groups_clear_user_group_cache_on_invitation_change( $args )   X-Ref
Clear caches on invitation deletion or update.
This also catches changes like sending an invite or marking one as accepted.

since: 5.0.0
param: array $args Associative array of columns/values describing invitations about to be deleted.

bp_groups_clear_user_group_cache_on_other_events( $user_id, $group_id )   X-Ref
Clear group memberships cache on miscellaneous actions not covered by the 'after_save' hook.

since: 2.6.0
param: int $user_id  Current user ID.
param: int $group_id Current group ID.

bp_groups_reset_cache_incrementor()   X-Ref
Reset cache incrementor for the Groups component.

This function invalidates all cached results of group queries,
whenever one of the following events takes place:
- A group is created or updated.
- A group is deleted.
- A group's metadata is modified.

since: 2.7.0
return: bool True on success, false on failure.

bp_groups_reset_cache_incrementor_on_group_term_change( $object_id, $terms, $tt_ids, $taxonomy )   X-Ref
Reset cache incrementor for Groups component when a group's taxonomy terms change.

We infer that a group is being affected by looking at the objects belonging
to the taxonomy being affected.

since: 2.7.0
param: int    $object_id ID of the item whose terms are being modified.
param: array  $terms     Array of object terms.
param: array  $tt_ids    Array of term taxonomy IDs.
param: string $taxonomy  Taxonomy slug.
return: bool True on success, false on failure.

bp_groups_reset_cache_incrementor_on_group_term_remove( $object_id, $terms, $taxonomy )   X-Ref
Reset cache incrementor for Groups component when a group's taxonomy terms are removed.

We infer that a group is being affected by looking at the objects belonging
to the taxonomy being affected.

since: 2.7.0
param: int    $object_id ID of the item whose terms are being modified.
param: array  $terms     Array of object terms.
param: string $taxonomy  Taxonomy slug.
return: bool True on success, false on failure.



Generated: Sun Apr 28 01:01:05 2024 Cross-referenced by PHPXref 0.7.1