bp_dtheme_activity_secondary_avatars

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

Description

(string) bp_dtheme_activity_secondary_avatars( (string) $action, (BP_Activity_Activity) $activity ); 

Returns (string)

Parameters (2)

0. $action (string)
The text of this activity
1. $activity (BP_Activity_Activity)
Activity object

Usage

  1. if ( !function_exists( 'bp_dtheme_activity_secondary_avatars' ) ) { 
  2. require_once '/bp-themes/bp-default/functions.php'; 
  3.  
  4. // The text of this activity 
  5. $action = ''; 
  6.  
  7. // Activity object 
  8. $activity = null; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = bp_dtheme_activity_secondary_avatars($action, $activity); 
  12.  

Defined (1)

The function is defined in the following location(s).

/bp-themes/bp-default/functions.php  
  1. function bp_dtheme_activity_secondary_avatars( $action, $activity ) { 
  2. switch ( $activity->component ) { 
  3. case 'groups' : 
  4. case 'friends' : 
  5. // Only insert avatar if one exists 
  6. if ( $secondary_avatar = bp_get_activity_secondary_avatar() ) { 
  7. $reverse_content = strrev( $action ); 
  8. $position = strpos( $reverse_content, 'a<' ); 
  9. $action = substr_replace( $action, $secondary_avatar, -$position - 2, 0 ); 
  10. break; 
  11.  
  12. return $action;