bp_embed_activity_save_cache( string $cache, string $cachekey, int $id )

Set an activity item’s embed cache.

Description

Used during BP_Embed::parse_oembed() via bp_activity_embed().

See also

Parameters

$cache

(Required) An empty string passed by BP_Embed::parse_oembed() for functions like this one to filter.

$cachekey

(Required) The cache key generated in BP_Embed::parse_oembed().

$id

(Required) The ID of the activity item.

Source

File: bp-activity/bp-activity-functions.php

function bp_embed_activity_save_cache( $cache, $cachekey, $id ) {
	bp_activity_update_meta( $id, $cachekey, $cache );

	// Cache full oEmbed response.
	if ( true === isset( buddypress()->activity->oembed_response ) ) {
		$cachekey = str_replace( '_oembed', '_oembed_response', $cachekey );
		bp_activity_update_meta( $id, $cachekey, buddypress()->activity->oembed_response );
	}
}

Changelog

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