Skip to:
Content

BuddyPress.org

Opened 5 years ago

Closed 5 years ago

#8136 closed enhancement (fixed)

We should have `Secondary Item Id` in filters for `friends_format_notifications` function

Reported by: bhargavbhandari90's profile bhargavbhandari90 Owned by: imath's profile imath
Milestone: 6.0.0 Priority: normal
Severity: normal Version: 4.4.0
Component: Core Keywords: has-patch 2nd-opinion
Cc:

Description

In file src/bp-friends/bp-friends-notifications.php

We have a function friends_format_notifications to get notification of user friendships.

In the function there are 4 filters as follow:

  • - bp_friends_single_friendship_accepted_notification
  • - bp_friends_multiple_friendship_accepted_notification
  • - bp_friends_single_friendship_request_notification
  • - bp_friends_multiple_friendship_request_notification

But for these filters, we don't have secondary item id passed in arguments. Some users might need that secondary item id as well.

Let me know if there is specific reason not to pass secondary item id in those filters.

Attachments (3)

8136.patch (1.6 KB) - added by bhargavbhandari90 5 years ago.
8136-1.patch (1.6 KB) - added by bhargavbhandari90 5 years ago.
made documentation alignment proper
8136-2.patch (1.8 KB) - added by bhargavbhandari90 5 years ago.
Add secondary id in filter to array format

Download all attachments as: .zip

Change History (11)

@bhargavbhandari90
5 years ago

made documentation alignment proper

#1 follow-up: @imath
5 years ago

  • Milestone changed from Awaiting Review to Up Next

Thanks for your patch @bhargavbhandari90, let's work on it during the next development cycle.

#2 in reply to: ↑ 1 @bhargavbhandari90
5 years ago

Replying to imath:

Thanks for your patch @bhargavbhandari90, let's work on it during the next development cycle.

Sure.

#3 follow-up: @dcavins
5 years ago

Looks good to me. Let's add the parameter to both the string and array versions of the logic. Thanks, @bhargavbhandari90!

@bhargavbhandari90
5 years ago

Add secondary id in filter to array format

#4 in reply to: ↑ 3 @bhargavbhandari90
5 years ago

Replying to dcavins:

Looks good to me. Let's add the parameter to both the string and array versions of the logic. Thanks, @bhargavbhandari90!

Thanks @dcavins . I forgot about that.

#5 @imath
5 years ago

  • Milestone changed from Up Next to 6.0.0

Move the first tickets to next major release.

#6 @espellcaste
5 years ago

@imath This one seems to have an "approved" patch from @dcavins

Do you have any feedback, with improvements to the patch or possible breaking changes it might incur?

#7 @imath
5 years ago

  • Keywords 2nd-opinion added

I believe .2.patch can be committed what do you think @dcavins

#8 @imath
5 years ago

  • Owner set to imath
  • Resolution set to fixed
  • Status changed from new to closed

In 12597:

BP Friends: improve the filter of the formatting notification function

Add the $secondary_item_id parameter to the following dynamic filter:
bp_friends_{$amount}_friendship_{$action}_notification

Props bhargavbhandari90, dcavins, espellcaste

Fixes #8136

Note: See TracTickets for help on using tickets.