Skip to:
Content

BuddyPress.org

Ticket #5380: 5380.01.diff

File 5380.01.diff, 1.5 KB (added by imath, 6 years ago)
  • bp-core/bp-core-avatars.php

     
    10331033                $user_id = bp_displayed_user_id();
    10341034
    10351035        $retval = false;
    1036         if ( bp_core_fetch_avatar( array( 'item_id' => $user_id, 'no_grav' => true, 'html' => false ) ) != bp_core_avatar_default() )
     1036        if ( bp_core_fetch_avatar( array( 'item_id' => $user_id, 'no_grav' => true, 'html' => false ) ) != bp_core_avatar_default( 'local' ) )
    10371037                $retval = true;
    10381038
    10391039        return (bool) apply_filters( 'bp_get_user_has_avatar', $retval, $user_id );
  • bp-groups/bp-groups-template.php

     
    28722872                return apply_filters( 'bp_get_group_current_avatar', $group_avatar );
    28732873        }
    28742874
    2875 function bp_get_group_has_avatar() {
    2876         global $bp;
     2875function bp_get_group_has_avatar( $group_id = null ) {
    28772876
    2878         if ( !empty( $_FILES ) || !bp_core_fetch_avatar( array( 'item_id' => $bp->groups->current_group->id, 'object' => 'group', 'no_grav' => true ) ) )
     2877        if ( empty( $group_id ) ) {
     2878                $group_id = buddypress()->groups->current_group->id;
     2879        }
     2880
     2881        if ( ! empty( $_FILES ) || bp_core_avatar_default( 'local' ) == bp_core_fetch_avatar( array( 'item_id' => $group_id, 'object' => 'group', 'no_grav' => true, 'html' => false ) ) )
    28792882                return false;
    28802883
    28812884        return true;