Skip to:
Content

BuddyPress.org

Changeset 7585


Ignore:
Timestamp:
11/16/2013 07:39:10 PM (11 years ago)
Author:
boonebgorges
Message:

When swapping WP avatars, use 'full' type if requested size is larger than BP thumbs.

This prevents unsightly stretching.

Fixes #5074

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core/bp-core-avatars.php

    r7433 r7585  
    832832    }
    833833
     834    // Use the 'thumb' type, unless the requested width is bigger than
     835    // BP's thumb width.
     836    $type = 'thumb';
     837    if ( (int) $size > bp_core_avatar_thumb_width() ) {
     838        $type = 'full';
     839    }
     840
    834841    // Let BuddyPress handle the fetching of the avatar
    835     $bp_avatar = bp_core_fetch_avatar( array( 'item_id' => $id, 'width' => $size, 'height' => $size, 'alt' => $alt ) );
     842    $bp_avatar = bp_core_fetch_avatar( array(
     843        'item_id' => $id,
     844        'type'    => $type,
     845        'width'   => $size,
     846        'height'  => $size,
     847        'alt'     => $alt,
     848    ) );
    836849
    837850    // If BuddyPress found an avatar, use it. If not, use the result of get_avatar
Note: See TracChangeset for help on using the changeset viewer.