Here’s a quick tip straight from the BP-Trac created by R-A-Y. Put the snippet below in your child theme’s functions.php or in your bp-custom.php:

[php] /* Add a new activity stream item for when people change their Profile Picute */
function xprofile_new_avatar_activity() {
global $bp;

if ( !function_exists( ‘bp_activity_add’ ) )
return false;

$user_id = apply_filters( ‘xprofile_new_avatar_user_id’, $bp->displayed_user->id );

$userlink = bp_core_get_userlink( $user_id );

bp_activity_add( array(
‘user_id’ => $user_id,
‘action’ => apply_filters( ‘xprofile_new_avatar_action’, sprintf( __( ‘%s uploaded a new profile picture’, ‘buddypress’ ), $userlink ), $user_id ),
‘component’ => ‘profile’,
‘type’ => ‘new_avatar’
) );
add_action( ‘xprofile_avatar_uploaded’, ‘xprofile_new_avatar_activity’ );

Now when a user changes his avatar a new entry gets added to the stream notifying everyone of the new profile picture. Awesome!

This functionality will probably be added to BP 1.3 so keep an eye out when you update to 1.3 in the future. It might cause a conflict!

Source: R-A-Y his patch on BP-Trac

Leave a Reply

Your email address will not be published. Required fields are marked *