BuddyDev

Search

[Resolved] BuddyDev Moderation: Exclude specific groups from having the Report button.

Tagged: 

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

    We have some groups that we have created, not user generated ones. Like our Support group. I would like to remove the Report button from that group.

    I can probably find a way to target it with CSS. But I was hoping there could be a way to exclude specific groups, users, or forums from getting a report button.

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

    Hi Gregg,
    Thank you for the topic.

    It is doable with filters.

    Our team will assist you on Monday/Tuesday with the code.

    Regards
    Brajesh

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

    Awesome! Thank you Brajesh.

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on #24386

    Hello Gregg,

    Please try the following code. It will hide report button form certatin groups.

    
    function buddydev_modify_report_button( $button, $args ) {
    
    	if ( 'bp_group' != $args['item_type'] ) {
    		return $button;
    	}
    
            // Replace by you groups id.
    	$hide_for_groups = array( 43, 42 );
    
    	if ( in_array( $args['item_id'], $hide_for_groups ) ) {
    		$button = '';
    	}
    
    	return $button;
    }
    
    add_filter( 'bpmts_report_button', 'buddydev_modify_report_button', 10, 2 );
    
    

    Please let me know if works.

    Regards
    Ravi

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

    That works awesome. Thank you so much!

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on #24403

    Hello Gregg,

    Thank you for the acknowledgment.

    Regards
    Ravi

The topic ‘ [Resolved] BuddyDev Moderation: Exclude specific groups from having the Report button.’ is closed to new replies.

This topic is: resolved