Skip to:
Content

BuddyPress.org

Changeset 8969


Ignore:
Timestamp:
08/28/2014 04:47:18 PM (5 years ago)
Author:
johnjamesjacoby
Message:

Prevent debug notices in bp_get_avatar_to_crop_src() when there is no uploaded avatar to crop yet. This is particularly helpful when removing the avatar upload steps and creating an all-ajax experience.

File:
1 edited

Legend:

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

    r8831 r8969  
    211211        $url = isset( $bp->avatar_admin->image->url )
    212212            ? $bp->avatar_admin->image->url
    213             : $url = '';
     213            : '';
    214214
    215215        return apply_filters( 'bp_get_avatar_to_crop', $url );
     
    228228     */
    229229    function bp_get_avatar_to_crop_src() {
    230         return apply_filters( 'bp_get_avatar_to_crop_src', str_replace( WP_CONTENT_DIR, '', buddypress()->avatar_admin->image->dir ) );
     230        $bp  = buddypress();
     231        $src = isset( $bp->avatar_admin->image->dir )
     232            ? str_replace( WP_CONTENT_DIR, '', $bp->avatar_admin->image->dir )
     233            : '';
     234
     235        return apply_filters( 'bp_get_avatar_to_crop_src', $src );
    231236    }
    232237
Note: See TracChangeset for help on using the changeset viewer.