Tagged: hide user, mystery man
HI Brajesh Singh,
What would the php code be to Hide users that have no avatars (mystery men) in the Recently Active widgets press?
Screenshot:
Hi Kristian,
BuddyPress does not store the avatar presence in database.You will need some way to track it.
Our plugins
– BuddyPress Users with uploaded avatar
– BuddyPress Force Profile Photo
– BuddyPress profile Completiontrack the avatar status in meta, if you have any of these, Please take a look here for solution
https://buddydev.com/support/forums/topic/members-without-profile-picture/
Regards
BrajeshI have the BuddyPress Force Profile Photo plugin, but the bots just sit there in in recently active after sign up with mystery man avatars.
It’s good that they cannot do anything 🙂 but bad that they fill up the recently active buddypress widget 🙁
I will look at the other suggestions and link now too.
Ah it doesn’t work for me sadly:
The php:
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; } );
still shows the users in the recently active despite having the BuddyPress Force Profile Photo plugin.
Any suggestions on what I can do the the code?
Hi Kristian,
The force profile photo uses a different key.Please use the following code instead
add_action( 'bp_after_has_members_parse_args', function ( $args ) { $args['meta_key'] = 'has_avatar'; $args['meta_value'] = 1; return $args; } );
Please let me know if that works or not?
Regards
Brajesh
You must be logged in to reply to this topic.