BuddyDev

Search

[Resolved] BuddyPress Moderation 1.2.4 release, a couple issues.

  • Keymaster
    (BuddyDev Team)
    Posts: 22211
    Brajesh Singh on #26242

    Hi Gregg,
    The release introduced a filter like this

    
    apply_filters( 'bpmts_is_user_whitelisted', is_super_admin( $user_id ), $user_id );
    

    You can use the filter to white list users(I believe I noted it in the release note).

    We plan to gradually enhance this and add a section in settings to whitelist users too.

    Regards
    Brajesh

  • Participant
    Level: Enlightened
    Posts: 73
    Gregg Housh on #26249

    As I have said before many times, I am smart and I notice things…

    Sorry I didn’t see that. A filter is great.

    Thanks gain for all the awesome support around here!

  • Participant
    Level: Enlightened
    Posts: 73
    Gregg Housh on #26250

    I’ve attempted to create the code in functions.php for this, but users who I have whitelisted still have the report button on their profile, and their activities. Is this code correct?

    
    function whitelist_users_from_moderation($is_super_admin, $user_id) {
    	// Default whitelist all super admins
    	$whitelist = $is_super_admin;
    	
    	$whitelisted_user_ids = array( 2, 95 );
    	
    	if ( in_array( $user_id, $whitelisted_user_ids) ) {
    		$whitelist = true;
    	}
    	
    	return $whitelist;
    }
    add_filter('bpmts_is_user_whitelisted', 'whitelist_users_from_moderation', 10, 2);
    
    
  • Keymaster
    (BuddyDev Team)
    Posts: 22211
    Brajesh Singh on #26256

    Hi Gregg,
    Thank you.

    Your code is correct. Try reporting the user’s content and see what happens.

    Since the front end report button is used too many times, we are not checking it when button is shown(it avoid n queries for author of that content). We test it when it is reported.

    PS:- I just realized that in the current state of whitelisting, if a user is white listed, their contents can not be reported but they profile of a use can still be reported. I will fix it in the next update.

    Regards
    Brajesh

  • Participant
    Level: Enlightened
    Posts: 73
    Gregg Housh on #26259

    Great! Thanks again. Everything is working how it should then.

  • Keymaster
    (BuddyDev Team)
    Posts: 22211
    Brajesh Singh on #26271

    You are welcome.

    marking it resolved.

    Regards
    brajesh

The topic ‘ [Resolved] BuddyPress Moderation 1.2.4 release, a couple issues.’ is closed to new replies.

This topic is: resolved