Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
04/27/2016 03:59:26 PM (8 years ago)
Author:
boonebgorges
Message:

Introduce 'mystery group' avatar for groups without custom avatar.

This nifty new image is totally grouperiffic, and it's gonna supercharge
your BuddyPress community, to the extreme.

As part of the improvement, Gravatar requests for group avatars have been
disabled by default. Gravatar requests never match for groups, anyway, so
this should save HTTP requests in most cases. Filter 'bp_core_fetch_avatar_no_grav'
to restore the previous behavior.

Props sooskriszta, abweb.
Fixes #6372.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-groups/bp-groups-template.php

    r10652 r10721  
    600600            'class'      => $r['class'],
    601601            'width'      => $r['width'],
    602             'height'     => $r['height']
     602            'height'     => $r['height'],
    603603        ) );
    604604
     
    47064706            'id'      => 'avatar-crop-preview',
    47074707            'alt'     => __( 'Group photo', 'buddypress' ),
    4708             'no_grav' => false
    47094708        ), 'get_new_group_avatar' );
    47104709
     
    51495148    }
    51505149
    5151     $group_avatar = bp_core_fetch_avatar( array(
     5150    $avatar_args = array(
    51525151        'item_id' => $group_id,
    51535152        'object'  => 'group',
    51545153        'no_grav' => true,
    51555154        'html'    => false,
    5156     ) );
    5157 
    5158     if ( bp_core_avatar_default( 'local' ) === $group_avatar ) {
     5155        'type'    => 'thumb',
     5156    );
     5157
     5158    $group_avatar = bp_core_fetch_avatar( $avatar_args );
     5159
     5160    if ( bp_core_avatar_default( 'local', $avatar_args ) === $group_avatar ) {
    51595161        return false;
    51605162    }
Note: See TracChangeset for help on using the changeset viewer.