Skip to:
Content

BuddyPress.org

Changeset 10144


Ignore:
Timestamp:
09/25/2015 06:16:05 PM (9 years ago)
Author:
imath
Message:

Make sure the thumb size is used to crop the thumb avatar

2.3.0 introduced the BP_Attachment_Avatar class to manage avatar uploads. Unfortunately the full avatar size was mistakenly used to set full and thumb avatars.
This commit makes sure the right size will be used to set the avatars.

Props damland

See #6634 (branch 2.3)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.3/src/bp-core/classes/class-bp-attachment-avatar.php

    r9831 r10144  
    259259
    260260        foreach ( $avatar_types as $key_type => $type ) {
    261             $args['dst_w']    = bp_core_avatar_full_width();
    262             $args['dst_h']    = bp_core_avatar_full_height();
     261            if ( 'thumb' === $key_type ) {
     262                $args['dst_w'] = bp_core_avatar_thumb_width();
     263                $args['dst_h'] = bp_core_avatar_thumb_height();
     264            } else {
     265                $args['dst_w'] = bp_core_avatar_full_width();
     266                $args['dst_h'] = bp_core_avatar_full_height();
     267            }
     268
    263269            $args['dst_file'] = $avatar_folder_dir . '/' . wp_hash( $absolute_path . time() ) . '-bp' . $key_type . '.' . $ext;
    264270
Note: See TracChangeset for help on using the changeset viewer.