Make WordPress Core

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#24596 closed defect (bug) (invalid)

get_avatar() is using BuddyPress thumb image

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

Description

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 11 years ago.

Download all attachments as: .zip

Change History (6)

@henrywright
11 years ago

#1 @henrywright
11 years ago

  • Cc henry@… added
  • Version set to 3.5.1

#2 @henrywright
11 years ago

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

#3 @SergeyBiryukov
11 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():
http://buddypress.trac.wordpress.org/browser/tags/1.7.2/bp-core/bp-core-avatars.php#L692

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

#4 @henrywright
11 years ago

@SergeyBiryukov thanks.

Note: See TracTickets for help on using tickets.