-
do_action( 'bp_embed_update_cache', $cache, $cachekey, $id )
Source Reference:
-
if ( !empty( $cache ) ) { return apply_filters( 'bp_embed_oembed_html', $cache, $url, $attr, $rawattr ); // If no cache, ping the oEmbed provider and cache the result } else { $html = wp_oembed_get( $url, $attr ); $cache = ( $html ) ? $html : $url; // Let components / plugins save their cache do_action( 'bp_embed_update_cache', $cache, $cachekey, $id ); // If there was a result, return it if ( $html ) return apply_filters( 'bp_embed_oembed_html', $html, $url, $attr, $rawattr ); } } // Still unknown return $this->maybe_make_link( $url ); }
-
Hook: add_action: bp_embed_update_cache instances (3)
-
add_action( 'bp_embed_update_cache', 'bp_embed_forum_save_cache', 10, 3 )
Source Reference:
-
* @see BP_Embed * @see bp_embed_forum_cache() * @see bp_embed_forum_save_cache() * @package BuddyPress_Forums * @since 1.5 */ function bp_forums_embed() { add_filter( 'embed_post_id', 'bp_get_the_topic_post_id' ); add_filter( 'bp_embed_get_cache', 'bp_embed_forum_cache', 10, 3 ); add_action( 'bp_embed_update_cache', 'bp_embed_forum_save_cache', 10, 3 ); } add_action( 'topic_loop_start', 'bp_forums_embed' ); /** * Wrapper function for {@link bb_get_postmeta()}. * Used during {@link BP_Embed::parse_oembed()} via {@link bp_forums_embed()}. * * @package BuddyPress_Forums * @since 1.5 */
-
Hook: add_action: bp_embed_update_cache instances (3)
-
add_action( 'bp_embed_update_cache', 'bp_embed_activity_save_cache', 10, 3 )
Source Reference:
-
* @see bp_embed_activity_save_cache() * * @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_activity_save_cache() * * @uses add_filter() To attach 'bp_get_activity_comment_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_comment_embed() { add_filter( 'embed_post_id', 'bp_get_activity_comment_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( 'bp_before_activity_comment', 'bp_activity_comment_embed' ); /** * When a user clicks on a "Read More" item, make sure embeds are correctly parsed and shown for the expanded content. * * @since 1.5 * * @see BP_Embed *
-
Hook: add_action: bp_embed_update_cache instances (3)
-
add_action( 'bp_embed_update_cache', 'bp_embed_activity_save_cache', 10, 3 )
Source Reference:
-
* @uses add_action() To attach 'bp_embed_activity_save_cache' to 'bp_embed_update_cache' */ function bp_dtheme_embed_read_more( $activity ) { global $bp; $bp->activity->read_more_id = $activity->id; add_filter( 'embed_post_id', create_function( '', 'global $bp; return $bp->activity->read_more_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( 'bp_dtheme_get_single_activity_content', 'bp_dtheme_embed_read_more' ); /** * Removes the 'embed_post_id' filter after {@link bp_activity_recurse_comments()} * is rendered to avoid conflict with the 'embed_post_id' filter in * {@link bp_activity_embed()} or any other component embeds. * * @since 1.5 *
-