BP_Legacy::secondary_avatars( string $action, BP_Activity_Activity $activity )

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


Description Description


Parameters Parameters

$action

(Required) The text of this activity.

$activity

(Required) Activity object.


Top ↑

Return Return

(string)


Top ↑

Source Source

File: bp-templates/bp-legacy/buddypress-functions.php

	function 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
1.7.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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