BuddyDev

Search

[Resolved] User can report their own comment – Buddypress Moderation Tool

  • Participant
    Level: Initiated
    Posts: 1
    Muzammil Khan on #35247

    Hello,
    Awesome plugin! Everything is working great. The only problem is user can report their comments. I haven’t custom coded anything.

    Can you please help me fix this issue?

    Suggestion:
    *) Can you please add blocking feature in this plugin as it will be much easier to moderate everything in one place.

    Thank you.

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 2935
    Ravi on #35262

    Hello Muzammil,

    Thank you for posting. Please try the following code.

    
    
    /**
     * Modify report button args.
     *
     * @param array $args Array.
     *
     * @return array
     */
    function buddydev_modify_report_button_args( $args ) {
    
    	if ( 'bp_acomment' != $args['item_type'] ) {
    		return $args;
    	}
    
    	if ( bp_loggedin_user_id() == bp_get_activity_comment_user_id() ) {
    		return array();
    	}
    
    	return $args;
    }
    add_filter( 'bpmts_report_button_args', 'buddydev_modify_report_button_args' );
    

    Regards
    Ravi

  • Participant
    Level: Initiated
    Posts: 1
    Muzammil Khan on #35278

    Thank you so much. It solved the issue 🙂

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 2935
    Ravi on #35281

    Thank You for the acknowledgement. I am glad I could help.

You must be logged in to reply to this topic.

This topic is: resolved