Custom Default Avatar For Buddypress

code in functions

function myavatar_add_default_avatar( $url )
{
return get_stylesheet_directory_uri() .’/images/myimage.jpg’;
}
add_filter( ‘bp_core_mysteryman_src’, ‘myavatar_add_default_avatar’ );

Change the Default Avatar

function my_default_get_group_avatar($avatar) {
global $bp, $groups_template;
if( strpos($avatar,’group-avatars’) ) {
return $avatar;
}
else {
$custom_avatar = get_stylesheet_directory_uri() .’/images/myimage.jpg’;
if($bp->current_action == “”)
return ‘group->name ) . ‘” />’;
else
return ‘group->name ) . ‘” />’;
}
}
add_filter( ‘bp_get_group_avatar’, ‘my_default_get_group_avatar’);


Custom Default Avatar