Skip to:
Content
Pages
Categories
Search
Top
Bottom

removing DELETE from activity stream


  • karmatiger
    Participant

    @karmatiger

    I’ve tried add_filter('bp_activity_delete','__return_false'); but apparently that’s not the right hook.

Viewing 5 replies - 1 through 5 (of 5 total)

  • shanebp
    Moderator

    @shanebp

    Are you referring to the Delete button on an activity item?

    If so, create a template overload of this file:
    buddypress\bp-templates\bp-legacy\buddypress\activity\entry.php
    And then remove this line:
    <?php if ( bp_activity_user_can_delete() ) bp_activity_delete_link(); ?>


    karmatiger
    Participant

    @karmatiger

    Thanks Shane 🙂 I was thinking hook solution when I should have just overridden the file creating the output. That’s what I get when fixing on one solution.


    jbboro3
    Participant

    @jbboro3

    Why don’t you just put this two lines of css code in your theme’s css or custom css page instead of trying to get into functions files..

    a.button.item-button.bp-secondary-action.delete-activity.confirm {
    display: none;
    }
    a.delete.acomment-delete.confirm.bp-secondary-action {
    display: none;
    }


    karmatiger
    Participant

    @karmatiger

    I realised this affected the stream on a person’s profile as well, and removing the button removed a member’s ability to delete an update they posted.

    It bothers me having a large DELETE below the activity entry, making the activity feed longer and uglier than it needs be.

    I’d like to move it to the entry header; instead of:

    KarmaTiger posted an update
    3 hours, 5 minutes ago

    it would say

    KarmaTiger posted an update
    3 hours, 5 minutes ago (delete)

    but the entry header is a function ( bp_activity_action() )and not easy to add on to (or find). Do any of you far more experienced buddypress users know how I may do this?


    karmatiger
    Participant

    @karmatiger

    Also, jbboro3, this comes down to personal opinion but I hate having the server crunch everything that could be done, then hiding output.

    In this case it’s six of one, half a dozen of the other as the css code to hide it isn’t that big, but in some cases the code to create the thing is huge and learning how to safely delete said code, rather than process it then hide the result, can increase site page load times.

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.
Skip to toolbar