BuddyDev

Search

[Resolved] Remove What’s New Form from Single Gallery Comments

  • Participant
    Level: Initiated
    Posts: 17
    buddyuser on #44863

    I was just wondering if it was possible to remove (or restrict based on a user can/user role to achieve same result) the What’s New Form from Single Gallery comments?

    I was looking through the template files hoping to find where the post-form is for Gallery Comments for Media Press, but had no such luck.

  • Keymaster
    (BuddyDev Team)
    Posts: 24149
    Brajesh Singh on #44869

    Hi,
    Thank you for the question.
    sure, here is an example

    
    
    add_filter( 'mpp_user_can_comment_on_gallery', function($can, $gallery_id) {
    
        if( ! is_user_logged_in() ) {
            return $can;// should be false.
        }
    
        // modify the $can based on current user and return
        $can = false;// I am disabling it.
    
        return $can;
    }, 10, 2);
    
    

    Please feel free to customize it as you need.

    Hope it helps.

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 17
    buddyuser on #44876

    Thanks Brajesh, that worked perfectly 🙂

  • Keymaster
    (BuddyDev Team)
    Posts: 24149
    Brajesh Singh on #44885

    You are welcome.

You must be logged in to reply to this topic.

This topic is: resolved