Opened 11 years ago
Closed 11 years ago
#5558 closed enhancement (fixed)
bp_has_notifications() additional filtering does not work
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 2.1 | Priority: | normal |
Severity: | normal | Version: | 1.9 |
Component: | Toolbar & Notifications | Keywords: | needs-refresh commit |
Cc: |
Description
At the moment, bp_has_notifications()
cannot be used when trying to do finer-grained filtering.
For example, if ( bp_has_activities( 'component_name=activity' ) )
will grab all notifications instead of just activity-related ones.
Attached patch:
- Swaps out
BP_Notifications_Notification::get_current_notifications_for_user()
with the more, liberalBP_Notifications_Notification::get()
. This allowsbp_has_notifications()
to be used in a less-restricting manner.
- Fleshs out the default arguments in both
bp_has_notifications()
/BP_Notifications_Template
to use everything available. We don't have to do this in two places. At the very least, this should be done inBP_Notifications_Template
. - Fixes the
$is_new
variable being undefined ifbp_has_notifications()
is used outside of a user's notifications page. - Fixes the
$max
argument inBP_Notifications_Template
. - Adds a unit test.
Attachments (2)
Change History (7)
This ticket was mentioned in IRC in #buddypress-dev by r-a-y. View the logs.
11 years ago
This ticket was mentioned in IRC in #buddypress-dev by paulgibbs. View the logs.
11 years ago
This ticket was mentioned in IRC in #buddypress-dev by paulgibbs. View the logs.
11 years ago
Note: See
TracTickets for help on using
tickets.
Sorry r-a-y that it's taken so long for someone to look at your patch. I think the enhancement is fine, and the unit test works as expected. However, it was pretty hard to get the patch to apply to current trunk (to be expected after three months, really). It would be nice to get this into 2.1; do you think you have time to update the patch and then commit it?