BuddyDev

Search

[Resolved] How to disable all activity meta buttons

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

    Hi

    Please is there a filter to disable all activity meta buttons (comment, favorite, delete)

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

    Hi Tosin,
    Thank you for the question.

    There are always the way to disable it. The solution is good or not will depend on theme/template pack being used.

    Which theme and template pack are you using? If you are using a custom theme, the theme developer is the best person to approach.

    Regards
    brajesh

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

    im using the legacy template

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

    Hi Tosin,
    My suggestion would be override the buddypress/activity/entry.php and remove the code.

    There are filters to disable the buttons but they will affect all other locations for these buttons.

    If that is fine, we can use use the filters instead.

    Regards
    Brajesh

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

    The filters are ok

    I also don’t want the comments to be recorded in database

    For example when a user comments on a blog post, buddypress should not record a corresponding activity for the comment.

    Thanks

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

    Hi Tosin.
    Please use the following code for diabling buttons:-

    
    // Disable activity comment.
    add_filter( 'bp_activity_can_comment', '__return_false' );
    // Disable activity favourite.
    add_filter( 'bp_activity_can_favorite', '__return_false' );
    // Disable activity deletion.
    add_filter( 'bp_activity_user_can_delete', '__return_false' );
    
    

    and you can use the following for blog post comment recording

    
    
    // Disable blog comment recording.
    add_filter( "bp_activity_post_pre_comment", '__return_false' );
    add_filter( "bp_activity_pre_transition_post_type_comment_status", '__return_true' );
    
    

    You should also disable the Blog/Forum post commenting in the Dashboard->Settings->BuddyPress->Options tab.

    Regards
    Brajesh

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

    Thanks Brajesh this is now resolved

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

    Thank you for confirming Tosin.

The topic ‘ [Resolved] How to disable all activity meta buttons’ is closed to new replies.

This topic is: resolved