Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
06/18/2013 08:30:26 PM (11 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

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