Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
07/30/2014 05:36:09 PM (7 years ago)
Author:
imath
Message:

Disable Group avatar feature if WordPress show avatars setting is disabled

In WordPress Administration Discussion settings, if the option "Show Avatars" is not on, we need to disable the Group Avatar feature to avoid some notices and be consistent with the discussion option.

Fixes #5345
See #5494

File:
1 edited

Legend:

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

    r8705 r8737  
    14051405
    14061406        // Get group name and avatar
    1407         $avatar  = bp_core_fetch_avatar( array(
    1408             'item_id'    => $item['id'],
    1409             'object'     => 'group',
    1410             'type'       => 'thumb',
    1411             'avatar_dir' => 'group-avatars',
    1412             'alt'        => sprintf( __( 'Group logo of %s', 'buddypress' ), $group_name ),
    1413             'width'      => '32',
    1414             'height'     => '32',
    1415             'title'      => $group_name
    1416         ) );
     1407        $avatar = '';
     1408
     1409        if ( buddypress()->avatar->show_avatars ) {
     1410            $avatar  = bp_core_fetch_avatar( array(
     1411                'item_id'    => $item['id'],
     1412                'object'     => 'group',
     1413                'type'       => 'thumb',
     1414                'avatar_dir' => 'group-avatars',
     1415                'alt'        => sprintf( __( 'Group logo of %s', 'buddypress' ), $group_name ),
     1416                'width'      => '32',
     1417                'height'     => '32',
     1418                'title'      => $group_name
     1419            ) );
     1420        }
    14171421
    14181422        $content = sprintf( '<strong><a href="%s">%s</a></strong>', esc_url( $edit_url ), $group_name );
Note: See TracChangeset for help on using the changeset viewer.