Skip to:
Content
Pages
Categories
Search
Top
Bottom

Prevent user from deleting their activity


  • Nik
    Participant

    @nikbond

    Hi there

    Is there any way of preventing users (other than admin) from deleting their own activity eg. I don’t want them to be able to delete entries such as “User x updated their profile”.

    I’ve successfully prevented commenting on certain activities using bp_activity_can_comment and I’m thinking maybe I can use bp_activity_user_can_delete in a similar way, but can’t seem to make that work.

    Any suggestions would be gratefully received.

    With many thanks in advance.

    PS. I know I can hide “Delete” with CSS but would really prefer to use a filter instead.

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

  • Venutius
    Moderator

    @venutius

    You could overload activity/entry.php and instead of:

    if ( bp_activity_user_can_delete() ) bp_activity_delete_link();

    You could do:

    if ( current_user_can('manage_options') ) bp_activity_delete_link();

    That’s one option.


    Nik
    Participant

    @nikbond

    @Venutius

    Ah thank you for your prompt reply and yes… that seems to work quite well. Certainly good enough for my purposes for now.

    Warmr regards.

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