bp_groups_clear_user_group_cache_on_invitation_change( array $args )

Clear caches on invitation deletion or update.


Description Description

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


Top ↑

Parameters Parameters

$args

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


Source 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' );
	}
}


Top ↑

Changelog Changelog

Changelog
Version Description
5.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.