bp_media_clear_album_group_object_cache_on_delete( array $albums )

Clear a group’s cached album count when delete.

Description

Parameters

$albums

(Required) DB results of album items.

Source

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

function bp_media_clear_album_group_object_cache_on_delete( $albums ) {
	if ( ! empty( $albums[0] ) ) {
		foreach ( (array) $albums[0] as $deleted_album ) {
			$group_id = ! empty( $deleted_album->group_id ) ? $deleted_album->group_id : false;

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

Changelog

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