bp_groups_clear_user_group_cache_on_other_events( int $user_id, int $group_id )

Clear group memberships cache on miscellaneous actions not covered by the ‘after_save’ hook.

Description

Parameters

$user_id

(Required) Current user ID.

$group_id

(Required) Current group ID.

Source

File: bp-groups/bp-groups-cache.php

function bp_groups_clear_user_group_cache_on_other_events( $user_id, $group_id ) {
	wp_cache_delete( $user_id, 'bp_groups_memberships_for_user' );

	$membership = new BP_Groups_Member( $user_id, $group_id );
	wp_cache_delete( $membership->id, 'bp_groups_memberships' );
}

Changelog

Changelog
Version Description
BuddyPress 2.6.0 Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.