Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to remove or hide friendship notifaction after accept or reject


  • cisdev
    Participant

    @cisdev

    Hello
    I am working with buddypress 2.1.1, and how to remove or hide notification after accept or reject friendship.

    is there any filter or function for hide or remove for friend ship notification
    please give me solution because i am unable to find.

    Thanks

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

  • Henry Wright
    Moderator

    @henrywright

    This will stop the email notification:

    remove_action( 'friends_friendship_accepted', 'friends_notification_accepted_request', 10, 3 );

    And this will stop the web notification:

    remove_action( 'friends_friendship_accepted', 'bp_friends_add_friendship_accepted_notification', 10, 3 );

    Hope this helps!


    cisdev
    Participant

    @cisdev

    @henrywright, Thanks for your reply.
    I have try using your given code in theme file function.php file

    remove_action( ‘friends_friendship_accepted’, ‘bp_friends_add_friendship_accepted_notification’, 10, 3 );

    for notification section but it is not working also we have change status in database table” wp_bp_friends” is_confirmed=1 but friend-ship notification still display in notification section like read and unread/delete display

    I want remove or hide friend-ship notification from notification section after accept or reject.
    please give solution.

    Thanks in advance.


    Henry Wright
    Moderator

    @henrywright

    remove_action( 'friends_friendship_accepted', 'bp_friends_add_friendship_accepted_notification', 10, 3 );

    That should stop the notifications from happening going forward. It wont remove notifications already added.


    cisdev
    Participant

    @cisdev

    @henrywright,
    So no need to add
    remove_action( ‘friends_friendship_accepted’, ‘bp_friends_add_friendship_accepted_notification’, 10, 3 );
    code on theme function.php file
    is there any another solution or we have add this code in another file.
    it work for both if accept or reject friendship ?


    Henry Wright
    Moderator

    @henrywright

    So no need to add
    remove_action( ‘friends_friendship_accepted’, ‘bp_friends_add_friendship_accepted_notification’, 10, 3 );
    code on theme function.php file

    Are you saying you don’t need to stop notifications?


    cisdev
    Participant

    @cisdev

    Thanks for your reply @henrywright

    I want remove or hide friend-ship notification from notification section after accept or reject.
    please give solution.


    Henry Wright
    Moderator

    @henrywright

    OK, try this:

    remove_action( 'friends_friendship_accepted', 'bp_friends_add_friendship_accepted_notification', 10 );

    It is a slight modification to the code I gave you in my earlier post.


    cisdev
    Participant

    @cisdev

    Hello @henrywright I have tried this given code but not working i have added given code
    remove_action( ‘friends_friendship_accepted’, ‘bp_friends_add_friendship_accepted_notification’, 10 );

    i have my notification please check, which i want remove

    Unread/ Read

    Viewing 1 – 3 of 3 notifications

    Notification Date Received Actions

    You have a friendship request from Ram 5 days, 7 hours ago Accept Reject
    Read | Delete

    You have a friendship request from manish 1 week ago Accept Reject
    Read | Delete

    Ashok sent you a new private message 1 month, 2 weeks ago Read | Delete

    I want remove or hide friendship request if Accepted or Rejected
    please give me solution.


    Henry Wright
    Moderator

    @henrywright

    Try accepting a friendship request with the code I have you in place (it goes in functions.php). You shouldn’t get a new notification.


    cisdev
    Participant

    @cisdev

    Thanks for giving code ,i have try with new friendship but it is not working my added code is
    remove_action( ‘friends_friendship_accepted’, ‘bp_friends_add_friendship_accepted_notification’, 10 );
    if you have solution please give me suggestion or custom code

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘How to remove or hide friendship notifaction after accept or reject’ is closed to new replies.
Skip to toolbar