[buddypress-trac] [BuddyPress Trac] #6686: Users marked as spam are visible in friends list

buddypress-trac noreply at wordpress.org
Mon Oct 26 09:16:53 UTC 2015


#6686: Users marked as spam are visible in friends list
---------------------------------+-----------------------------
 Reporter:  finzend              |      Owner:
     Type:  defect (bug)         |     Status:  new
 Priority:  normal               |  Milestone:  Awaiting Review
Component:  Component - Members  |    Version:
 Severity:  normal               |   Keywords:
---------------------------------+-----------------------------
 When I mark someone as a spammer, this user is still visible in other
 members lists with friends. I'm not sure if this is desired behaviour, but
 I would think its not.

 I've made a filter to fix this for now (see below, just fyi), but let me
 know if its gonna be 'fixed' in a next milestone.

 {{{#!php
 <?php

 function ab_filter_banned_users($hasmembers, $mymembers) {
   if (isset($mymembers->members)) {

     $mycounter = 0;
     foreach($mymembers->members as $useridx => $myuser) {
         if ($myuser->spam==1){
                 //echo $myuser->user_login;
                 unset($mymembers->members[$useridx]);
                 $mycounter++;
         }
     }

     $mymembers->member_count = ($mymembers->member_count - $mycounter);

   }
   return $mymembers;
 }

 add_filter( 'bp_has_members', 'ab_filter_banned_users', 10, 2);

 }}}

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/6686>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list