Skip to:
Content

BuddyPress.org

Opened 10 years ago

Closed 10 years ago

#4503 closed enhancement (fixed)

bp_core_fetch_avatar hooking into get_avatar

Reported by: melindrea's profile melindrea Owned by:
Milestone: 1.7 Priority: normal
Severity: normal Version:
Component: Core Keywords: has-patch
Cc: jkudish@…

Description

In its' core, get_avatar returns the gravatar with the classes avatar, avatar-$size and photo. Buddypress hooks in to the get_avatar filter (line 686, bp-core-avatars.php) to see if there is a locally uploaded avatar. The gravatar returned, whether local or not, has the classes avatar and user-$id-avatar.

I feel that it would be a good idea if the filter returned the same classes as the get_avatar, since it's very unexpected behaviour for them to not be there.

Attachments (2)

4503.diff (1.3 KB) - added by jkudish 10 years ago.
bp_core_fetch_avatar(): adjust how the image width is set and how the html width attribute is created and add avatar-$width and photo classes to the html output by the function
4503-2.diff (3.7 KB) - added by jkudish 10 years ago.
piggy back on top of the first patch and simplify a few things and make sure they are escaped too

Download all attachments as: .zip

Change History (8)

#1 @DJPaul
10 years ago

  • Milestone changed from Awaiting Review to 1.7

I can't see any reason not to do this?

#2 @DJPaul
10 years ago

  • Owner set to DJPaul
  • Status changed from new to assigned

#3 @DJPaul
10 years ago

Looking at these, we need to patch bp_core_fetch_avatar_filter(). We could use $width for the avatar-$size class, but $width is an optional parameter. If it's not set, what then? bp_core_avatar_full_width()? bp_core_avatar_thumb_width()?

Doesn't look to be too hard to patch if someone wants to go for it. The scope of the ticket is to add "avatar-$size" and "photo" to the avatars.

@jkudish
10 years ago

bp_core_fetch_avatar(): adjust how the image width is set and how the html width attribute is created and add avatar-$width and photo classes to the html output by the function

@jkudish
10 years ago

piggy back on top of the first patch and simplify a few things and make sure they are escaped too

#4 @jkudish
10 years ago

  • Cc jkudish@… added
  • Keywords has-patch added

#5 @DJPaul
10 years ago

  • Owner DJPaul deleted

#6 @johnjamesjacoby
10 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

(In [6601]) Clean up bp_core_fetch_avatar(). Props jkudish. Fixes #4503.

Note: See TracTickets for help on using tickets.