Skip to:
Content
Pages
Categories
Search
Top
Bottom

BuddyPress Profile Images


  • tammywashington
    Participant

    @tammywashington

    We are using WordPress Multisite version 4.2.2 with sub-domain folders. We are using the following plugins:

    BuddyPress ver. 2.2.3.1, BuddyPress Xprofile Custom Fields Type ver. 2.1.6, and s2Member Framework ver. 150311 + s2Member Pro v150311.

    When a user uploads their avatar image to the primary website along with additional BuddyPress Profile Custom Field information the avatar image does not show in the subdomain for the user account. We added the following code to the bp-custom.php file suggested from this link but it still does not allow the profiles images to show in the sub-domain:

     /* This fixes the 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);
Viewing 3 replies - 1 through 3 (of 3 total)

  • danbp
    Moderator

    @danbp

    Annoying issue, was initially reported for BP 1.7

    See https://buddypress.trac.wordpress.org/ticket/4948

    Reopen the ticket, give details and this topic url
    To login use same credentials as for here.


    rbaccaro
    Participant

    @rbaccaro

    This is working for me:

    Add to wp-config.php:
    define( 'BP_ENABLE_MULTIBLOG', true );

    Add to bp-custom.php (under plugins folder):

    /* This fixes the 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);

    But I am still having problems with the cover.

    Anyone?

    Thank you,


    rbaccaro
    Participant

    @rbaccaro

    bp_core_is_multisite is deprecated.

    Use is_multisite.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘BuddyPress Profile Images’ is closed to new replies.
Skip to toolbar