BuddyDev

Search

BuddyPress Moderation Tools support

  • Participant
    Level: Guru
    Posts: 900
    Tosin on #26601

    Version 1.2.5

  • Keymaster
    (BuddyDev Team)
    Posts: 24706
    Brajesh Singh on #26602

    Were you logged in as admin while reporting?

  • Participant
    Level: Guru
    Posts: 900
    Tosin on #26603

    No but the role of all my users is set to contributor

  • Keymaster
    (BuddyDev Team)
    Posts: 24706
    Brajesh Singh on #26604

    Contributor should not be the issue.

    When you clicked the submit button on the reporting form, what message did it show? Are you sure the posts were generated by the user in the list.

    Can you please login as one of the white listed user and post an activity and then try to report it(by submitting the form) from another account.

    Regards
    Brajesh

  • Participant
    Level: Guru
    Posts: 900
    Tosin on #26605

    Yes I just logged in as a white listed user and published a blog post then logged in again with another user in a private browser and both the user profile and blog post was reported successfully with the message (Thank you for reporting.) I also confirmed that the post and the user was reported from the moderation queue in the admin dashboard.

  • Keymaster
    (BuddyDev Team)
    Posts: 24706
    Brajesh Singh on #26606

    Hi Tosin,
    I am sorry for the inconvenience.

    There was a small bug in the code for stopping the profile of a user from being related(it should return false not true).
    I am still not sure why your content is not being white listed.

    Here is the updated code(only 2nd part has 1 line changed)

    
    
    // 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 = false;
    	}
    
    	return $is;
    }, 10, 3 );
    
    

    Please try reporting a user now.

    Regards
    Brajesh

  • Participant
    Level: Guru
    Posts: 900
    Tosin on #26607

    Its still reporting

  • Keymaster
    (BuddyDev Team)
    Posts: 24706
    Brajesh Singh on #26608

    Is there any chance you are using any filter/custom code related to moderation tools other than the above?

  • Participant
    Level: Guru
    Posts: 900
    Tosin on #26609

    No not at all this will be the first code related to the moderation plugin im also running php 7.4 im not sure if this is of any help

  • Keymaster
    (BuddyDev Team)
    Posts: 24706
    Brajesh Singh on #26610

    Hi Tosin,
    Thank you for the details.

    I am sorry but it seem strange. I did not test the code(though I am pretty sure it works). Please allow me to check it today and get back to you by early tomorrow.

    Regards
    Brajesh

You must be logged in to reply to this topic.

This topic is: not resolved