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:


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:

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.