Skip to:
Content

BuddyPress.org

Opened 11 months ago

Closed 5 months ago

#8136 closed enhancement (fixed)

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

Reported by: bhargavbhandari90 Owned by: 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 11 months ago.
8136-1.patch (1.6 KB) - added by bhargavbhandari90 11 months ago.
made documentation alignment proper
8136-2.patch (1.8 KB) - added by bhargavbhandari90 11 months ago.
Add secondary id in filter to array format

Download all attachments as: .zip

Change History (11)

@bhargavbhandari90
11 months ago

made documentation alignment proper

#1 follow-up: @imath
11 months 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
11 months ago

Replying to imath:

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

Sure.

#3 follow-up: @dcavins
11 months ago

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

@bhargavbhandari90
11 months ago

Add secondary id in filter to array format

#4 in reply to: ↑ 3 @bhargavbhandari90
11 months 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
11 months ago

  • Milestone changed from Up Next to 6.0.0

Move the first tickets to next major release.

#6 @espellcaste
5 months 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 months ago

  • Keywords 2nd-opinion added

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

#8 @imath
5 months 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.