Skip to:
Content
Pages
Categories
Search
Top
Bottom

Change visibility of avatars > hide for not-logged-in users

  • @datenfresser

    Participant

    Hi all,
    one (hopefully simple) question:
    The users of my community-website upload personal photos as avatars. Now I want to give them more privacy:
    How can I hide the avatars with photos from all users who are NOT logged in? Instead of the photo-avatar the default-avatar should be displayed.

    After the login to the site the photo-avatars should be displayed normally.

    Is this possible?

    Thanks for help!

    Greetings, Miriam

Viewing 3 replies - 1 through 3 (of 3 total)
  • @shanebp

    Moderator

    It’s a lot easier just to turn off avatars if the user is not logged in.
    Try this in your theme functions.php or in bp-custom.php.

    function fresser_turn_off_avatars() {
         $bp = buddypress();
    	
         if ( ! is_user_logged_in() )
    	$bp->avatar->show_avatars = false;
    	
    }
    add_action('bp_core_set_avatar_globals', 'fresser_turn_off_avatars' );

    @suiteplugins

    Participant

    I have created a plugin specifically for this.

    BP Private Avatars

    Let me know what you think.

    @datenfresser

    Participant

    Thanks a lot. I did it with your Plugin and modified it a little. Works well 🙂

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Change visibility of avatars > hide for not-logged-in users’ is closed to new replies.
Skip to toolbar