bp_dtheme_activity_secondary_avatars( string $action, BP_Activity_Activity $activity )

Add secondary avatar image to this activity stream’s record, if supported.


Parameters Parameters

$action

(string) (Required) The text of this activity

$activity

(BP_Activity_Activity) (Required) Activity object


Top ↑

Return Return

(string)


Source Source

File: bp-themes/bp-default/functions.php

function bp_dtheme_activity_secondary_avatars( $action, $activity ) {
	switch ( $activity->component ) {
		case 'groups' :
		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;
}


Top ↑

Changelog Changelog

Changelog
Version Description
BuddyPress (1.2.6) Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.