[buddypress-trac] [BuddyPress] #4908: Avoid switch_to_blog in bp_core_fetch_avatar
buddypress-trac
noreply at wordpress.org
Tue Apr 2 16:43:03 UTC 2013
#4908: Avoid switch_to_blog in bp_core_fetch_avatar
-------------------------+-----------------------------
Reporter: wpdennis | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Core | Version:
Severity: normal | Keywords: dev-feedback
-------------------------+-----------------------------
In a multisite installation with buddypress enabled (network wide) every
''get_avatar()'' triggers a switch_to_blog() on child sites.
The reason is the check, whether avatars are activated:
{{{
if ( ! bp_get_option( 'show_avatars' ) )
return;
}}}
in http://buddypress.trac.wordpress.org/browser/trunk/bp-core/bp-core-
avatars.php#L96
''bp_get_option()'' forces the ''switch_to_blog()'' to get the option from
the root blog for every avatar. I don't see a way to avoid this in current
version.
Can we add a simple check for a constant like "BP_AVATAR_ENABLED" or
something to give the chance to avoid this ''bp_get_option()'' - call?
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/4908>
BuddyPress <http://buddypress.org/>
BuddyPress
More information about the buddypress-trac
mailing list