Ticket #2152: 2152.01.patch
File 2152.01.patch, 1.8 KB (added by , 10 years ago) |
---|
-
src/bp-groups/bp-groups-template.php
781 781 return false; 782 782 } 783 783 784 // If not in group loop, 785 $group = ! empty( $groups_template->group ) 786 ? $groups_template->group 787 : groups_get_current_group(); 788 789 // If no group, provide some sane defaults to mask developer error 790 if ( empty( $group ) ) { 791 $group = (object) array( 792 'name' => __( 'Unknown Group', 'buddypress' ), 793 'id' => 0, 794 'avatar_full' => bp_core_avatar_default(), 795 'avatar_thumb' => bp_core_avatar_default_thumb() 796 ); 797 } 798 784 799 // Parse the arguments 785 800 $r = bp_parse_args( $args, array( 786 801 'type' => 'full', … … 788 803 'height' => false, 789 804 'class' => 'avatar', 790 805 'id' => false, 791 'alt' => sprintf( __( 'Group logo of %s', 'buddypress' ), $group s_template->group->name )806 'alt' => sprintf( __( 'Group logo of %s', 'buddypress' ), $group->name ) 792 807 ) ); 793 808 794 809 // Fetch the avatar from the folder 795 810 $avatar = bp_core_fetch_avatar( array( 796 'item_id' => $group s_template->group->id,797 'title' => $group s_template->group->name,811 'item_id' => $group->id, 812 'title' => $group->name, 798 813 'avatar_dir' => 'group-avatars', 799 814 'object' => 'group', 800 815 'type' => $r['type'], … … 807 822 808 823 // If No avatar found, provide some backwards compatibility 809 824 if ( empty( $avatar ) ) { 810 $avatar = '<img src="' . esc_url( $group s_template->group->avatar_thumb ) . '" class="avatar" alt="' . esc_attr( $groups_template->group->name ) . '" />';825 $avatar = '<img src="' . esc_url( $group->avatar_thumb ) . '" class="avatar" alt="' . esc_attr( $group->name ) . '" />'; 811 826 } 812 827 813 828 return apply_filters( 'bp_get_group_avatar', $avatar, $r );