BuddyDev

Search

[Resolved] Hide report button on main groups listing page

Tagged: ,

  • Participant
    Level: Enlightened
    Posts: 72
    Nifty on #39225

    Hello,

    I’ve recently purchased and installed the BuddyPress Moderation Tools plugin – thanks for producing a plugin that does exactly what it says it will do!

    I was hoping to be able to hide the report button from the main groups directory page though, so that it will then only show up on the group’s page (similar to what you can do for users via Settings > Users > Show in members listing). Is there any option to do this?

    Many thanks.

  • Keymaster
    (BuddyDev Team)
    Posts: 24623
    Brajesh Singh on #39234

    Hi Nifty,
    Thank you for using the plugin. I am glad you liked it.

    At the moment, we haven’t provided the settings for it.

    Please put this in your child theme’s functions.php

    
    /**
     * Disables Report button on groups directory.
     */
    add_filter( 'bpmts_is_reporting_button_enabled', function ( $is_enabled, $location, $args ) {
    
    	if ( 'bp_groups_loop' === $location ) {
    		$is_enabled = false;
    	}
    
    	return $is_enabled;
    }, 10, 3 );
    
    

    That will disable it for groups directory.

    Regards
    Brajesh

  • Participant
    Level: Enlightened
    Posts: 72
    Nifty on #39236

    Hi Brajesh,

    Thanks so much for that piece of code, it works perfectly.

    Thank you.

  • Keymaster
    (BuddyDev Team)
    Posts: 24623
    Brajesh Singh on #39253

    Hi Nifty,
    Thank you for confirming.

    Regards
    Brajesh

The topic ‘ [Resolved] Hide report button on main groups listing page’ is closed to new replies.

This topic is: resolved