Skip to:
Content

BuddyPress.org

Ticket #5345: 5345.diff

File 5345.diff, 4.5 KB (added by imath, 6 years ago)
  • bp-groups/bp-groups-adminbar.php

     
    5757        ) );
    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,
    6363                        'id'     => 'group-avatar',
  • bp-groups/bp-groups-buddybar.php

     
    3535
    3636                        <li><a href="<?php bp_groups_action_link( 'admin/group-settings' );  ?>"><?php _e( 'Group Settings', 'buddypress' ); ?></a></li>
    3737
    38                         <?php if ( !(int)bp_get_option( 'bp-disable-avatar-uploads' ) ) : ?>
     38                        <?php if ( !(int)bp_get_option( 'bp-disable-avatar-uploads' ) && $bp->avatar->show_avatars ) : ?>
    3939
    4040                                <li><a href="<?php bp_groups_action_link( 'admin/group-avatar' ); ?>"><?php _e( 'Group Avatar', 'buddypress' ); ?></a></li>
    4141
  • bp-groups/bp-groups-loader.php

     
    307307                ) );
    308308
    309309                // If avatar uploads are not disabled, add avatar option
    310                 if ( ! (int) buddypress()->site_options['bp-disable-avatar-uploads'] ) {
     310                if ( ! (int) buddypress()->site_options['bp-disable-avatar-uploads'] && $bp->avatar->show_avatars ) {
    311311                        $this->group_creation_steps['group-avatar'] = array(
    312312                                'name'     => __( 'Avatar',   'buddypress' ),
    313313                                'position' => 20
  • bp-groups/bp-groups-screens.php

     
    592592                return false;
    593593
    594594        // If the logged-in user doesn't have permission or if avatar uploads are disabled, then stop here
    595         if ( ! bp_is_item_admin() || (int) bp_get_option( 'bp-disable-avatar-uploads' ) )
     595        if ( ! bp_is_item_admin() || (int) bp_get_option( 'bp-disable-avatar-uploads' ) || ! buddypress()->avatar->show_avatars )
    596596                return false;
    597597
    598598        $bp = buddypress();
  • bp-groups/bp-groups-template.php

     
    520520                extract( $r, EXTR_SKIP );
    521521
    522522                /* Fetch the avatar from the folder, if not provide backwards compat. */
    523                 if ( !$avatar = bp_core_fetch_avatar( array( 'item_id' => $groups_template->group->id, 'object' => 'group', 'type' => $type, 'avatar_dir' => 'group-avatars', 'alt' => $alt, 'css_id' => $id, 'class' => $class, 'width' => $width, 'height' => $height, 'title' => $groups_template->group->name, 'alt' => $alt ) ) )
    524                         $avatar = '<img src="' . esc_url( $groups_template->group->avatar_thumb ) . '" class="avatar" alt="' . esc_attr( $groups_template->group->name ) . '" />';
     523                if ( !$avatar = bp_core_fetch_avatar( array( 'item_id' => $groups_template->group->id, 'object' => 'group', 'type' => $type, 'avatar_dir' => 'group-avatars', 'alt' => $alt, 'css_id' => $id, 'class' => $class, 'width' => $width, 'height' => $height, 'title' => $groups_template->group->name, 'alt' => $alt ) ) ) {
     524                        if( $bp->avatar->show_avatars ) {
     525                                $default_avatar = bp_is_group() ? bp_core_avatar_default() : bp_core_avatar_default_thumb();
     526                                $avatar = '<img src="' . esc_url( $default_avatar ) . '" class="avatar" alt="' . esc_attr( $groups_template->group->name ) . '" />';
     527                        }
     528                }
    525529
    526530                return apply_filters( 'bp_get_group_avatar', $avatar );
    527531        }
     
    14671471
    14681472        <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>
    14691473
    1470         <?php if ( !(int)bp_get_option( 'bp-disable-avatar-uploads' ) ) : ?>
     1474        <?php if ( !(int)bp_get_option( 'bp-disable-avatar-uploads' ) && $bp->avatar->show_avatars ) : ?>
    14711475
    14721476                <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( 'Avatar', 'buddypress' ); ?></a></li>
    14731477