Skip to:
Content

BuddyPress.org

Changeset 10145


Ignore:
Timestamp:
09/25/2015 06:19:46 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

Fixes #6634 (trunk)

File:
1 edited

Legend:

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

    r10108 r10145  
    270270
    271271        foreach ( $avatar_types as $key_type => $type ) {
    272             $args['dst_w']    = bp_core_avatar_full_width();
    273             $args['dst_h']    = bp_core_avatar_full_height();
     272            if ( 'thumb' === $key_type ) {
     273                $args['dst_w'] = bp_core_avatar_thumb_width();
     274                $args['dst_h'] = bp_core_avatar_thumb_height();
     275            } else {
     276                $args['dst_w'] = bp_core_avatar_full_width();
     277                $args['dst_h'] = bp_core_avatar_full_height();
     278            }
     279
    274280            $args['dst_file'] = $avatar_folder_dir . '/' . wp_hash( $absolute_path . time() ) . '-bp' . $key_type . '.' . $ext;
    275281
Note: See TracChangeset for help on using the changeset viewer.