Skip to:
Content
Pages
Categories
Search
Top
Bottom

How do you remove the group avatar from the activity stream post?

  • @spade5702

    Member

    When a member post to a group it shows up in the activity feed under “username posted an update in the group” then its followed by the group avatar then the group name. So I was wonder how I could remove the group avatar from the activity action. Is their anything I could add to the functions.php or bp-customs.php? I would rather not try hiding it through css.

Viewing 1 replies (of 1 total)
  • @chrisclayton

    Participant

    The secondary avatars are registered within the functions.php
    https://buddypress.trac.wordpress.org/browser/trunk/bp-themes/bp-default/functions.php#L554

    To remove it for groups, add this to your child theme’s functions and it will override the parent themes version.

    function bp_dtheme_activity_secondary_avatars( $action, $activity ) {
    switch ( $activity->component ) {
    case 'friends' :
    // Only insert avatar if one exists
    if ( $secondary_avatar = bp_get_activity_secondary_avatar() ) {
    $reverse_content = strrev( $action );
    $position        = strpos( $reverse_content, 'a<' );
    $action          = substr_replace( $action, $secondary_avatar, -$position - 2, 0 );
    }
    break;
    }
    
    return $action;
    }
    add_filter( 'bp_get_activity_action_pre_meta', 'bp_dtheme_activity_secondary_avatars', 10, 2 );
Viewing 1 replies (of 1 total)
  • The topic ‘How do you remove the group avatar from the activity stream post?’ is closed to new replies.
Skip to toolbar