Ticket #3429: 3429.01.patch
File 3429.01.patch, 4.0 KB (added by , 13 years ago) |
---|
-
bp-activity/bp-activity-functions.php
function bp_activity_get_permalink( $activity_id, $activity_obj = false ) { 923 923 if ( isset( $activity_obj->current_comment ) ) { 924 924 $activity_obj = $activity_obj->current_comment; 925 925 } 926 926 927 927 if ( 'new_blog_post' == $activity_obj->type || 'new_blog_comment' == $activity_obj->type || 'new_forum_topic' == $activity_obj->type || 'new_forum_post' == $activity_obj->type ) 928 928 $link = $activity_obj->primary_link; 929 929 else { … … function bp_activity_thumbnail_content_images( $content, $link = false ) { 994 994 /** Embeds *******************************************************************/ 995 995 996 996 /** 997 * Grabs the activity ID and attempts to retrieve the oEmbed cache (if it exists)997 * Grabs the activity update ID and attempts to retrieve the oEmbed cache (if it exists) 998 998 * during the activity loop. If no cache and link is embeddable, cache it. 999 999 * 1000 * This does not cover recursive activity comments, as they do not use a real loop. 1001 * For that, see {@link bp_activity_comment_embed()}. 1002 * 1000 1003 * @see BP_Embed 1001 1004 * @see bp_embed_activity_cache() 1002 1005 * @see bp_embed_activity_save_cache() … … function bp_activity_embed() { 1011 1014 add_action( 'activity_loop_start', 'bp_activity_embed' ); 1012 1015 1013 1016 /** 1017 * Grabs the activity comment ID and attempts to retrieve the oEmbed cache (if it exists) 1018 * when BP is recursing through activity comments {@link bp_activity_recurse_comments()}. 1019 * If no cache and link is embeddable, cache it. 1020 * 1021 * @see BP_Embed 1022 * @see bp_embed_activity_cache() 1023 * @see bp_embed_activity_save_cache() 1024 * @package BuddyPress Activity 1025 * @since 1.5 1026 */ 1027 function bp_activity_comment_embed() { 1028 add_filter( 'embed_post_id', 'bp_get_activity_comment_id' ); 1029 add_filter( 'bp_embed_get_cache', 'bp_embed_activity_cache', 10, 3 ); 1030 add_action( 'bp_embed_update_cache', 'bp_embed_activity_save_cache', 10, 3 ); 1031 } 1032 add_action( 'bp_before_activity_comment', 'bp_activity_comment_embed' ); 1033 1034 /** 1035 * Removes the 'embed_post_id' filter after {@link bp_activity_recurse_comments()} 1036 * is rendered to avoid conflict with the 'embed_post_id' filter in 1037 * {@link bp_activity_embed()} or any other component embeds. 1038 * 1039 * @see bp_activity_comment_embed() 1040 * @package BuddyPress Activity 1041 * @since 1.5 1042 */ 1043 function bp_activity_comment_after_recurse() { 1044 remove_filter( 'embed_post_id', 'bp_get_activity_comment_id' ); 1045 } 1046 add_action( 'bp_after_activity_comment', 'bp_activity_comment_after_recurse' ); 1047 1048 /** 1014 1049 * Wrapper function for {@link bp_activity_get_meta()}. 1015 1050 * Used during {@link BP_Embed::parse_oembed()} via {@link bp_activity_embed()}. 1016 1051 * -
bp-core/bp-core-classes.php
class BP_Embed extends WP_Embed { 1177 1177 } 1178 1178 1179 1179 // Get object ID 1180 $id = ''; 1180 1181 $id = apply_filters( 'embed_post_id', $id ); 1181 1182 1182 1183 // Is oEmbed discovery on? … … class BP_Embed extends WP_Embed { 1229 1230 1230 1231 // Grab cache and return it if available 1231 1232 if ( !empty( $cache ) ) { 1232 return apply_filters( ' embed_oembed_html', $cache, $url, $attr, $rawattr );1233 return apply_filters( 'bp_embed_oembed_html', $cache, $url, $attr, $rawattr ); 1233 1234 1234 1235 // If no cache, ping the oEmbed provider and cache the result 1235 1236 } else { -
bp-themes/bp-default/_inc/ajax.php
function bp_dtheme_get_single_activity_content() { 339 339 if ( !$activity ) 340 340 exit(); // todo: error? 341 341 342 do_action( 'bp_activity_action_get_single_activity_content', $_POST['activity_id'] ); 343 342 344 // Activity content retrieved through AJAX should run through normal filters, but not be 343 345 // truncated 344 346 remove_filter( 'bp_get_activity_content_body', 'bp_activity_truncate_entry', 5 );