Skip to:
Content

BuddyPress.org

Changeset 7222


Ignore:
Timestamp:
06/18/2013 08:30:26 PM (12 years ago)
Author:
boonebgorges
Message:

Pass activity arguments through to bp_activity_thumbnail_content_images()

This allows plugin authors greater flexibility when modifying a post's
thumbnail image as it'll appear in the blog activity stream, by filtering
'bp_activity_thumbnail_content_images'.

Fixes #5060

Props dcowgill

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-activity/bp-activity-functions.php

    r7193 r7222  
    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 $activity_args Optional. The args passed to the activity
     1529 *   creation function (eg bp_blogs_record_activity())
    15281530 *
    15291531 * @uses esc_attr()
     
    15321534 * @return string $content The content with images stripped and replaced with a single thumb.
    15331535 */
    1534 function bp_activity_thumbnail_content_images( $content, $link = false ) {
     1536function bp_activity_thumbnail_content_images( $content, $link = false, $args = false ) {
    15351537
    15361538    preg_match_all( '/<img[^>]*>/Ui', $content, $matches );
     
    15711573    }
    15721574
    1573     return apply_filters( 'bp_activity_thumbnail_content_images', $content, $matches );
     1575    return apply_filters( 'bp_activity_thumbnail_content_images', $content, $matches, $args );
    15741576}
    15751577
  • trunk/bp-blogs/bp-blogs-activity.php

    r7076 r7222  
    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 ) )
Note: See TracChangeset for help on using the changeset viewer.