I found this code in parorrey.com, but this code is to set a front end avatar uploading, and I only need buddypress use the core avatars thru simple local avatars plugin.
So, I only use the add_filter that replace the image source.
add_filter('bp_core_fetch_avatar', 'local_bp_insert_avatar', 3, 5);
function local_bp_insert_avatar($avatar = '', $params, $id) {
if(!is_numeric($id) || strpos($avatar, 'gravatar') === false) return $avatar;
$pic = get_user_meta($id, 'simple_local_avatar', true);
if (!$pic['full'] || $pic['full'] == '') return $avatar;
$avatar = preg_replace('/src=("|\').*?("|\')/i', 'src=\'' . $pic['full'] . '\'', $avatar);
return $avatar;
}
What I can´t find a way to use the thumbnail size of the avatar image file and not the original size.
(@lonchbox)
11 years, 3 months ago
Hi,
I love this Plugin, works every time I use. But this time I try to used with BuddyPress and does´t work propetly.
The plugin allow to upload a custom avatar file, but only works normal post comments, don´t use that avatar in the BuddyPress Activity timeline.
Any sujestion or idea how to fix it ?
Thanx.
https://wordpress.org/plugins/simple-local-avatars/