Skip to:
Content
Pages
Categories
Search
Top
Bottom

Only Show Members with Avatars


  • Chelsea
    Participant

    @chelzcer

    I’m trying to build a custom plugin/widget with most recently active members, but I only want to show those members that have uploaded a custom avatar. I’ve been told this is not possible without rewriting the core of BuddyPress. Has anyone done this? If so, how?

Viewing 4 replies - 1 through 4 (of 4 total)

  • Boone Gorges
    Keymaster

    @boonebgorges

    I have done something similar. The reason why you can’t do it automatically is that avatar information is not stored in the database. You can get around this by creating some database content corresponding to avatars. There is a do_action hook near the end of the avatar upload process. Hook your own custom function to that hook that saves a has_avatar metadat item in the usermeta table using update_user_meta(). Then, in your widget bp_has_members loop, either load up a bunch of members and filter out the ones without avatars, or filter the sql queries themselves to make sure you only get members who have the has_avatar metadata. Not super straightforward, but definitely possible.


    Chelsea
    Participant

    @chelzcer

    Hey Boone, Thanks for the quick reply. We’ll try that. :)


    RobotFX
    Participant

    @wattaman

    Boone, can you please explain this for all the noobs?! In a step-by-step way, with code examples etyc :)
    Thanks!

    @Watt – I’m looking for something similar and found this article: http://wpmu.org/how-to-create-a-gallery-of-members-avatars-in-buddypress/

    Hope that helps!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Only Show Members with Avatars’ is closed to new replies.
Skip to toolbar