Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
08/09/2010 11:07:56 PM (15 years ago)
Author:
johnjamesjacoby
Message:

Add support for secondary avatar items in activity feed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/1.2/bp-themes/bp-default/functions.php

    r3159 r3170  
    139139}
    140140add_filter( 'the_posts', 'bp_dtheme_fix_the_posts_on_activity_front' );
     141
     142function bp_dtheme_activity_secondary_avatars( $action, $activity ) {
     143    global $bp;
     144
     145    switch ( $activity->component ) {
     146        case $bp->groups->id :
     147        case $bp->blogs->id :
     148        case $bp->friends->id :
     149            $reverse_content = strrev( $action );
     150            $position        = strpos( $reverse_content, 'a<' );
     151            $action          = substr_replace( $action, bp_get_activity_secondary_avatar(), -$position - 2, 0 );
     152            break;
     153    }
     154
     155    return $action;
     156}
     157add_filter( 'bp_get_activity_action_pre_meta', 'bp_dtheme_activity_secondary_avatars', 10, 2 );
    141158
    142159/****
Note: See TracChangeset for help on using the changeset viewer.