[buddypress-trac] [BuddyPress Trac] #5958: Add object parameter to bp_core_fetch_avatar_no_grav
buddypress-trac
noreply at wordpress.org
Thu Oct 23 18:47:14 UTC 2014
#5958: Add object parameter to bp_core_fetch_avatar_no_grav
-------------------------+-----------------------------
Reporter: dcavins | Owner:
Type: enhancement | Status: new
Priority: low | Milestone: Awaiting Review
Component: Avatars | Version: 2.1
Severity: minor | Keywords: has-patch
-------------------------+-----------------------------
I'd like to add a second parameter to `bp_core_fetch_avatar_no_grav` so
that you can choose when you want to use Gravatars. For instance, I'd like
to skip the Gravatar check for group avatars since they're extremely
unlikely to turn anything up. (The "email address" used for groups is
`{$item_id}-{$object}@{bp_get_root_domain()}` )
Adding the `$object` parameter means I can tune the filter to only apply
to groups.
{{{
function no_gravatars_for_groups( $no_grav, $object ) {
if ( $object == 'group' )
$no_grav = true;
return $no_grav;
}
add_filter( 'bp_core_fetch_avatar_no_grav', 'no_gravatars_for_groups', 10,
2 );
}}}
Thanks!
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/5958>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac
More information about the buddypress-trac
mailing list