Skip to:
Content

BuddyPress.org

Ticket #5454: 5454.patch

File 5454.patch, 1.4 KB (added by jjeaton, 11 years ago)
  • bp-groups/bp-groups-template.php

     
    522522                extract( $r, EXTR_SKIP );
    523523
    524524                /* Fetch the avatar from the folder, if not provide backwards compat. */
    525                 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 ) ) )
    526                         $avatar = '<img src="' . esc_url( $groups_template->group->avatar_thumb ) . '" class="avatar" alt="' . esc_attr( $groups_template->group->name ) . '" />';
     525                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 ) ) ) {
    527526
     527                        /* Provide backwards compat. */
     528                        if ( isset( $groups_template->group->avatar_thumb ) ) {
     529                                $avatar = '<img src="' . esc_url( $groups_template->group->avatar_thumb ) . '" class="avatar" alt="' . esc_attr( $groups_template->group->name ) . '" />';
     530                        }
     531                }
     532
    528533                return apply_filters( 'bp_get_group_avatar', $avatar );
    529534        }
    530535