Hi Granmeh,
Thank you for the question.By default BuddyPress does not keep track if a user has uploaded avatar or not(in the database).
Is there any chance you might be using any of our plugin:-
1. BuddyPress profile Completion
2. Or BuddyPress Force Profile Photo
3. Or BuddyPress Users with uploaded avatarIf you are using any of these three, these track the avatar in user meta and I can help you with meta query.
Regards
BrajeshHey there,
I’m using “BuddyPress Force Profile Photo and I would like to display only users with the meta_value at “1” and meta_key at “_has_avatar” but I’m completely lost for displaying only users with picture in the members directory.
So your help would be great.
Laurent
Hi Laurent,
Thank you for the patience.Please add this to your bp-cusotm.php and let me know if it works or not?
add_action( 'bp_after_has_members_parse_args', function ( $args ) { if ( bp_is_members_directory() ) { $args['meta_key'] = '_has_avatar'; $args['meta_value'] = 1; } return $args; } );
Regards
BrajeshHi Laurent,
Thank you.Currently BuddyPress User query does not support multiple keys or user meta query in other ways.
I will suggest sticking with one plugin to have only one meta for the presence of avatar.
Regards
BrajeshHi Laurent,
That’s good to know.Best Regards
Brajesh
The topic ‘ [Resolved] Members without profile picture’ is closed to new replies.