Viewing 1 replies (of 1 total)
  • Thread Starter Pancho Perez

    (@lonchbox)

    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.

Viewing 1 replies (of 1 total)
  • The topic ‘Does′t work with BuddyPress’ is closed to new replies.