* @uses add_filter() To attach 'bp_get_activity_id' to 'embed_post_id'
* @uses add_filter() To attach 'bp_embed_activity_cache' to 'bp_embed_get_cache'
* @uses add_action() To attach 'bp_embed_activity_save_cache' to 'bp_embed_update_cache'
*/
function bp_activity_embed() {
add_filter( 'embed_post_id', 'bp_get_activity_id' );
add_filter( 'bp_embed_get_cache', 'bp_embed_activity_cache', 10, 3 );
add_action( 'bp_embed_update_cache', 'bp_embed_activity_save_cache', 10, 3 );
}
add_action( 'activity_loop_start', 'bp_activity_embed' );
/**
* Grabs the activity comment ID and attempts to retrieve the oEmbed cache (if it exists)
* when BP is recursing through activity comments {@link bp_activity_recurse_comments()}.
* If no cache and link is embeddable, cache it.
*
* @since 1.5
*
* @see BP_Embed
* @see bp_embed_activity_cache()