Skip to:
Content

BuddyPress.org

Changeset 8737


Ignore:
Timestamp:
07/30/2014 05:36:09 PM (5 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

Location:
trunk/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/deprecated/2.1.php

    r8683 r8737  
    388388            <li><a href="<?php bp_groups_action_link( 'admin/group-settings' );  ?>"><?php _e( 'Group Settings', 'buddypress' ); ?></a></li>
    389389
    390             <?php if ( !(int)bp_get_option( 'bp-disable-avatar-uploads' ) ) : ?>
     390            <?php if ( !(int)bp_get_option( 'bp-disable-avatar-uploads' ) && $bp->avatar->show_avatars ) : ?>
    391391
    392392                <li><a href="<?php bp_groups_action_link( 'admin/group-avatar' ); ?>"><?php _e( 'Group Profile Photo', 'buddypress' ); ?></a></li>
  • 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 );
  • trunk/src/bp-groups/bp-groups-adminbar.php

    r8677 r8737  
    5858
    5959    // Group Admin > Group avatar
    60     if ( !(int)bp_get_option( 'bp-disable-avatar-uploads' ) ) {
     60    if ( !(int)bp_get_option( 'bp-disable-avatar-uploads' ) && $bp->avatar->show_avatars ) {
    6161        $wp_admin_bar->add_menu( array(
    6262            'parent' => $bp->group_admin_menu_id,
  • trunk/src/bp-groups/bp-groups-loader.php

    r8705 r8737  
    254254
    255255        // If avatar uploads are not disabled, add avatar option
    256         if ( ! (int) buddypress()->site_options['bp-disable-avatar-uploads'] ) {
     256        if ( ! (int) $bp->site_options['bp-disable-avatar-uploads'] && $bp->avatar->show_avatars ) {
    257257            $this->group_creation_steps['group-avatar'] = array(
    258258                'name'     => _x( 'Profile Photo', 'Group screen nav', 'buddypress' ),
  • trunk/src/bp-groups/bp-groups-screens.php

    r8705 r8737  
    635635
    636636    // If the logged-in user doesn't have permission or if avatar uploads are disabled, then stop here
    637     if ( ! bp_is_item_admin() || (int) bp_get_option( 'bp-disable-avatar-uploads' ) )
     637    if ( ! bp_is_item_admin() || (int) bp_get_option( 'bp-disable-avatar-uploads' ) || ! buddypress()->avatar->show_avatars )
    638638        return false;
    639639
  • trunk/src/bp-groups/bp-groups-template.php

    r8678 r8737  
    556556        global $bp, $groups_template;
    557557
     558        if ( ! buddypress()->avatar->show_avatars ) {
     559            return false;
     560        }
     561
    558562        $defaults = array(
    559563            'type'   => 'full',
     
    15591563    <li<?php if ( 'group-settings' == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( bp_get_group_permalink( $group ) . 'admin/group-settings' ) ?>"><?php _e( 'Settings', 'buddypress' ); ?></a></li>
    15601564
    1561     <?php if ( !(int)bp_get_option( 'bp-disable-avatar-uploads' ) ) : ?>
     1565    <?php if ( !(int)bp_get_option( 'bp-disable-avatar-uploads' ) && buddypress()->avatar->show_avatars ) : ?>
    15621566
    15631567        <li<?php if ( 'group-avatar'   == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( bp_get_group_permalink( $group ) . 'admin/group-avatar' ) ?>"><?php _e( 'Profile Photo', 'buddypress' ); ?></a></li>
     
    17091713            $group = $groups_template->group;
    17101714        }
    1711    
     1715
    17121716        if ( empty( $user_id ) ) {
    17131717            $user_id = bp_loggedin_user_id();
Note: See TracChangeset for help on using the changeset viewer.