bp_groups_clear_user_group_cache_on_invitation_change( array $args )

Clear caches on invitation deletion or update.

Description

This also catches changes like sending an invite or marking one as accepted.

Parameters

$args

(array) (Required) Associative array of columns/values describing invitations about to be deleted.

Source

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

function bp_groups_clear_user_group_cache_on_invitation_change( $args ) {
	$args['fields' ] = 'ids';
	$affected_invitation_ids = groups_get_invites( $args );
	foreach ( $affected_invitation_ids as $invitation_id ) {
		wp_cache_delete( $invitation_id, 'bp_groups_invitations_as_memberships' );
	}
}

Changelog

Changelog
Version Description
BuddyPress 5.0.0 BuddyPress 5.0.0
BuddyBoss 1.3.5 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.