bp_blogs_clear_blog_object_cache( int $blog_id, int $user_id )

Clear the blog object cache.

Description

Parameters

$blog_id

(int) (Required) ID of the current blog.

$user_id

(int) (Required) ID of the user whose blog cache should be cleared.

Source

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

function bp_blogs_clear_blog_object_cache( $blog_id = 0, $user_id = 0 ) {
	if ( ! empty( $user_id ) ) {
		wp_cache_delete( 'bp_blogs_of_user_'        . $user_id, 'bp' );
		wp_cache_delete( 'bp_total_blogs_for_user_' . $user_id, 'bp' );
	}

	wp_cache_delete( 'bp_total_blogs', 'bp' );
}

Changelog

Changelog
Version Description
BuddyPress 1.0.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.