bp_document_clear_folder_group_object_cache_on_delete( array $folders )

Clear a group’s cached folder count when delete.

Description

Parameters

$folders

(Required) DB results of folder items.

Source

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

function bp_document_clear_folder_group_object_cache_on_delete( $folders ) {
	if ( ! empty( $folders[0] ) ) {
		foreach ( (array) $folders[0] as $deleted_folder ) {
			$group_id = ! empty( $deleted_folder->group_id ) ? $deleted_folder->group_id : false;

			if ( $group_id ) {
				wp_cache_delete( 'bp_total_folder_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.