Skip to:
Content
Pages
Categories
Search
Top
Bottom

Check for Avatar

  • @catyco

    Participant

    I am using the below function to check for Avatar. However the else condition is displaying when users are logged in via social media (FB, Twitter) and they have a profile picture. How can I ignore them? or how can I get their picture to download to the avatar directly

    function user_has_avatar(){
    global $bp;

    if ( bp_core_fetch_avatar( array( ‘item_id’ => $bp->loggedin_user->id, ‘no_grav’ => true,’html’=> false ) ) != bp_core_avatar_default() ){

    echo ‘Gravatar exists’;
    }
    else { echo ‘Neither avatar nor Gravatar exist.’;
    }
    }
    ?>

  • The topic ‘Check for Avatar’ is closed to new replies.
Skip to toolbar