Tag Archives: avatar

Buddypress avatars on all blogs of wordpress multisite MU

Sorry, this entry is only available in Brazilian Portuguese. For the sake of viewer convenience, the content is shown below in the alternative language. You may click the link to switch the active language.

Encontrei esta solução para fazer com que avatares locais de um Buddypress sejam exibidos em todos os blogs de um wordpress MU:

Anyeossays:

Ok, I just noticed what BP_AVATAR_URL and BP_AVATAR_DIR are setted relative to url and dir of user blog. I reeplaced that code for one what always use the same absolute paths (obtained from WP_CONTENT_URL and WP_CONTENT_DIR) using the global “uploads” directory. Now all avatars are the same in all weblogs.
If you like to do it edit the file bp-core/bp-core-avatars.php and modify this functions:

function bp_core_avatar_upload_path() {
$basedir = WP_CONTENT_DIR.'/uploads';
return apply_filters( 'bp_core_avatar_upload_path', $basedir );
}
function bp_core_avatar_url() {
 $baseurl = WP_CONTENT_URL.'/uploads';
 return apply_filters( 'bp_core_avatar_url', $baseurl );
 }

Do post:
http://www.amberweinberg.com/how-to-add-buddypress-avatars-to-wordpress-mu/