bp_media_clear_media_user_object_cache( object $media )

Clear a user’s cached media count.

Description

Parameters

$media

(Required) Media object item.

Source

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

function bp_media_clear_media_user_object_cache( $r ) {

	if ( ! empty( $r[0] ) && is_object( $r[0] ) ) {
		$user_id = ! empty( $r[0]->user_id ) ? $r[0]->user_id : false;
	} else {
		$user_id = ! empty( $r['user_id'] ) ? $r['user_id'] : false;
	}

	if ( $user_id ) {
		wp_cache_delete( 'bp_total_media_for_user_' . $user_id, 'bp' );
	}
}

Changelog

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