[buddypress-trac] [BuddyPress Trac] #4252: Avatars are (erroneously) stored locally when running BP_ENABLE_MULTIBLOG

buddypress-trac noreply at wordpress.org
Mon Sep 18 09:51:31 UTC 2017


#4252: Avatars are (erroneously) stored locally when running BP_ENABLE_MULTIBLOG
-----------------------------------------+------------------------
 Reporter:  douglance                    |       Owner:
     Type:  defect (bug)                 |      Status:  closed
 Priority:  normal                       |   Milestone:
Component:  Core                         |     Version:
 Severity:  normal                       |  Resolution:  duplicate
 Keywords:  reporter-feedback has-patch  |
-----------------------------------------+------------------------

Comment (by nanaboakye):

 Replying to [comment:10 lrv]:
 > Here is the code fixed for me avatar and group avatar problem that
 appeared after BP_ENABLE_MULTIBLOG had been activated.
 >
 > {{{
 > /* This fixes the BP_ENABLE_MULTIBLOG avatar problem */
 > function nfm_bp_avtar_upload_path_correct($path){
 >     if ( bp_core_is_multisite() ){
 >      //   $path = ABSPATH . get_blog_option( BP_ROOT_BLOG, 'upload_path'
 );
 >               $path = ABSPATH . 'wp-content/uploads/';
 >     }
 >     return $path;
 > }
 > add_filter('bp_core_avatar_upload_path',
 'nfm_bp_avtar_upload_path_correct', 1);
 >
 > function nfm_bp_avatar_upload_url_correct($url){
 >     if ( bp_core_is_multisite() ){
 >         $url = get_blog_option( BP_ROOT_BLOG, 'siteurl' ) . "/wp-
 content/uploads";
 >     }
 >     return $url;
 > }
 > add_filter('bp_core_avatar_url', 'nfm_bp_avatar_upload_url_correct', 1);
 >
 > }}}
 In which file do I place this code?

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/4252#comment:15>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list