Skip to:
Content

BuddyPress.org

Changeset 3852


Ignore:
Timestamp:
01/23/2011 09:45:14 PM (14 years ago)
Author:
djpaul
Message:

Fix URL to uploaded avatars on non-BP_ROOT_BLOG sites. Fixes #2451, #2574 and #2968. (trunk)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core/bp-core-avatars.php

    r3757 r3852  
    597597
    598598    // If multisite, and current blog does not match root blog, make adjustments
    599     if ( is_multisite() && BP_ROOT_BLOG != $current_blog->blog_id )
    600         $upload_dir['baseurl'] = str_replace( get_home_url( $current_blog->blog_id ) , get_home_url( BP_ROOT_BLOG ), $upload_dir['baseurl'] );
     599    if ( bp_core_is_multisite() && BP_ROOT_BLOG != $current_blog->blog_id )
     600        $upload_dir['baseurl'] = trailingslashit( get_blog_option( BP_ROOT_BLOG, 'home' ) ) . get_blog_option( BP_ROOT_BLOG, 'upload_path' );
    601601
    602602    return apply_filters( 'bp_core_avatar_url', $upload_dir['baseurl'] );
Note: See TracChangeset for help on using the changeset viewer.