BuddyDev

Search

BuddyPress Moderation Tools support

  • Participant
    Level: Guru
    Posts: 885
    Tosin on #26531

    Hello,

    Can you add support to disable moderation for specific selected users and post or post type categories.

    Thanks

  • Keymaster
    (BuddyDev Team)
    Posts: 24190
    Brajesh Singh on #26532

    Hi Tosin,
    You can enable/disable it for post types from the settings(General tab).

    Currently, we do not have settings to exclude users but we have a filter and if you can give me some ids, I can post the code for excluding them.

    Regards
    Brajesh

  • Participant
    Level: Guru
    Posts: 885
    Tosin on #26533

    I meant post (CATEGORIES) as in category taxonomies and not post types

    This are the IDs I want to exclude for users 284, 37845, 4578 and 2357

    Thanks

    • This reply was modified 4 years, 5 months ago by Tosin.
  • Keymaster
    (BuddyDev Team)
    Posts: 24190
    Brajesh Singh on #26535

    Hi Tosin,
    thank you for the clarification.

    providing a UI for categories is not in the plan and I do not see it as an efficient thing to do(testing against each report button for category).

    I will add a filter and put some code in future for category exclusion.

    for users exclusion, I will post the code today.
    By user exclusion, I am assuming you do not want any content from them to be reported by others.

    Regards
    Brajesh

  • Participant
    Level: Guru
    Posts: 885
    Tosin on #26537

    1.For Categories a filter for category IDs might will be helpful

    2. By user exclusion Yes I do not want any content from them to be reported by others. and the report button should not show on the user’s profile

  • Participant
    Level: Guru
    Posts: 885
    Tosin on #26574

    Any feedback sir thanks

  • Keymaster
    (BuddyDev Team)
    Posts: 24190
    Brajesh Singh on #26593

    Hi Tosin,
    I am sorry for the delay.

    Here is the code

    
    
    // BuddyPress Moderation Tools: White list specific user's content from moderation.
    add_filter( 'bpmts_is_user_whitelisted', function ( $is, $user_id ) {
    	$white_listed_users = array( 284, 37845, 4578, 2357 );
    	if ( in_array( $user_id, $white_listed_users, true ) ) {
    		$is = true;
    	}
    
    	return $is;
    }, 10, 2 );
    
    // BuddyPress Moderation Tools: Do not allow white listed user's profile to be reported.
    add_filter( 'bpmts_is_item_reportable', function ( $is, $item_type, $item_id ) {
    	if ( 'user' !== $item_type ) {
    		return $is;
    	}
    
    	$white_listed_users = array( 284, 37845, 4578, 2357 );
    	if ( in_array( $item_id, $white_listed_users, true ) ) {
    		$is = true;
    	}
    
    	return $is;
    }, 10, 3 );
    
    

    Please put it in your bp-custom.php and it will work.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 24190
    Brajesh Singh on #26594

    Also, I forgot to mention, for users content the buttons will appear but when someone will try to report, they will get an error that it can not be reported.

    The reason behind this decision was site performance.

    Regards
    Brajesh

  • Participant
    Level: Guru
    Posts: 885
    Tosin on #26598

    1. I just tested it now but the white listed ID’s User and Content can still be reported.

    2. For the User profiles I was wondering if the report button itself can be hidden entirely in the members directory and the single profile from the white listed users that is the REPORT BUTTON should not display for the user ID’s 284, 37845, 4578, 2357

    3. Just to be sure should the ID’s be white listed or black listed

    • This reply was modified 4 years, 5 months ago by Tosin.
  • Keymaster
    (BuddyDev Team)
    Posts: 24190
    Brajesh Singh on #26600

    Hi Tosin,
    Are you using the latest version of Moderation tools? The white listing option was added in our last release only.

    Regards
    Brajesh

You must be logged in to reply to this topic.

This topic is: not resolved