Make WordPress Core

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#24596 closed defect (bug) (invalid)

get_avatar() is using BuddyPress thumb image

Reported by: henrywright Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.5.1
Component: General Keywords:
Focuses: Cc:


I am using the get_avatar() function in the loop to display the post author's avatar.

<?php $author = get_the_author(); ?>
<?php echo get_avatar( get_the_author_meta('ID'), 120, '', $author ); ?>

In bp-custom.php, I have set a default height and width on BuddyPress avatars

define ( 'BP_AVATAR_THUMB_WIDTH', 40 );

define ( 'BP_AVATAR_THUMB_HEIGHT', 40 );

Even though my get_avatar() function is outputting an avatar 120x120 in size, the 40x40 BuddyPress thumb is being used which is resulting in a stretched avatar being displayed (see attached screenshot).

Attachments (1)

avatar.jpg (4.1 KB) - added by henrywright 8 years ago.

Download all attachments as: .zip

Change History (6)

8 years ago

#1 @henrywright
8 years ago

  • Cc henry@… added
  • Version set to 3.5.1

#2 @henrywright
8 years ago

  • Summary changed from get_avatar() using BuddyPress thumb image to get_avatar() is using BuddyPress thumb image

#3 @SergeyBiryukov
8 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

BuddyPress replaces the default get_avatar() output with bp_core_fetch_avatar_filter():

This should be reported on BuddyPress Trac: http://buddypress.trac.wordpress.org/.

#4 @henrywright
8 years ago

@SergeyBiryukov thanks.

#5 @henrywright
8 years ago

FYI just raised a ticket over at BP Trac


Note: See TracTickets for help on using tickets.