bp_document_clear_document_group_object_cache_on_delete( array $documents )

Clear a group’s cached document count when delete.

Description

Parameters

$documents

(Required) DB results of document items.

Source

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

function bp_document_clear_document_group_object_cache_on_delete( $documents ) {
	if ( ! empty( $documents[0] ) ) {
		foreach ( (array) $documents[0] as $deleted_document ) {
			$group_id = ! empty( $deleted_document->group_id ) ? $deleted_document->group_id : false;

			if ( $group_id ) {
				wp_cache_delete( 'bp_total_document_for_group_' . $group_id, 'bp' );
			}
		}
	}
}

Changelog

Changelog
Version Description
BuddyBoss 1.4.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.