Skip to:
Content

BuddyPress.org

Ticket #5060: activity_thumbnail_new_param.patch

File activity_thumbnail_new_param.patch, 1.8 KB (added by dcowgill, 11 years ago)
  • bp-activity/bp-activity-functions.php

    diff --git bp-activity/bp-activity-functions.php bp-activity/bp-activity-functions.php
    index cb23192..2d4faa8 100644
    function bp_activity_hide_user_activity( $user_id ) { 
    15251525 *
    15261526 * @param string $content The content to work with
    15271527 * @param string $link Optional. The URL that the image should link to
     1528 * @param array $args The activity request arguments
    15281529 *
    15291530 * @uses esc_attr()
    15301531 * @uses apply_filters() To call the 'bp_activity_thumbnail_content_images' hook
    15311532 *
    15321533 * @return string $content The content with images stripped and replaced with a single thumb.
    15331534 */
    1534 function bp_activity_thumbnail_content_images( $content, $link = false ) {
     1535function bp_activity_thumbnail_content_images( $content, $link = false, $args ) {
    15351536
    15361537        preg_match_all( '/<img[^>]*>/Ui', $content, $matches );
    15371538
    function bp_activity_thumbnail_content_images( $content, $link = false ) { 
    15701571                }
    15711572        }
    15721573
    1573         return apply_filters( 'bp_activity_thumbnail_content_images', $content, $matches );
     1574        return apply_filters( 'bp_activity_thumbnail_content_images', $content, $matches, $args );
    15741575}
    15751576
    15761577/**
  • bp-blogs/bp-blogs-activity.php

    diff --git bp-blogs/bp-blogs-activity.php bp-blogs/bp-blogs-activity.php
    index 46f5d19..f3004b8 100644
    function bp_blogs_record_activity( $args = '' ) { 
    7373
    7474        // Remove large images and replace them with just one image thumbnail
    7575        if ( !empty( $content ) )
    76                 $content = bp_activity_thumbnail_content_images( $content, $primary_link );
     76                $content = bp_activity_thumbnail_content_images( $content, $primary_link, $r );
    7777
    7878        if ( !empty( $action ) )
    7979                $action = apply_filters( 'bp_blogs_record_activity_action', $action );