Opened 15 years ago
Closed 7 months ago
#1475 closed enhancement (maybelater)
bp_get_total_unread_messages_count()
Reported by: | _DorsVenabili | Owned by: | |
---|---|---|---|
Milestone: | Priority: | trivial | |
Severity: | trivial | Version: | |
Component: | Messages | Keywords: | needs-patch |
Cc: | _DorsVenabili |
Description
This function returns the total unread messages of my Inbox, but it could be very useful to count if there is a administrator notice active aswell (the function should count it only if the user has not closed the notice). So, with a variable we could choose if we want to count only the unread messages or the unread messages more the admin's notices.
Change History (16)
#6
follow-up:
↓ 7
@
8 years ago
Only used in two places.
Inside messages_get_unread_count()
and bp_get_total_unread_messages_count()
#7
in reply to:
↑ 6
@
3 years ago
Replying to tw2113:
Only used in two places.
Inside
messages_get_unread_count()
andbp_get_total_unread_messages_count()
Thank you for your advising
#8
@
3 years ago
- Milestone changed from Awaiting Contributions to 11.0.0
- Owner set to espellcaste
- Status changed from new to assigned
#10
@
22 months ago
- Keywords needs-patch 2nd-opinion added
I might have an unpopular opinion about this request. I'd suggest NOT doing this. Here is why:
1 - The ticket does not have enough information to help me decide how useful this would be or what problem is solving;
2 - If you want to get the admin notices, you can use BP_Messages_Notice::get_total_notice_count()
, here I can see us improving this function since it doesn't seem to be getting only active notices, but all notices;
3 - bp_get_total_unread_messages_count
and BP_Messages_Notice::get_total_notice_count()
serve different types of messages, so I don't think they should be bundled together by the use of a param
/variable
.
I do think that we could introduce something like bp_get_total_unread_notices_count
, to get the total count of the current unread admin notices (assuming several can be created at the same time, which I think that's not currently possible or offered out of the box), which I'm guessing is what @_DorsVenabili is looking for.
#12
@
22 months ago
- Keywords good-first-bug 2nd-opinion removed
Hi @espellcaste
I'm very dubitative about the interest of mixing notices count with messages count. I think these are 2 different objects. BTW, that's why I moved notices publishing into the WP Admin screen since 3.0 (it's a community administrator only tool). IMHO, It should be a feature living outside of the Messages component (in core or in a Notice component).
There might be a limited interest to get the unread notice count, so why not introducing bp_get_total_unread_notices_count()
. So far, the feature only loads one notice at a time. So you get the n+1
notice once you've marked the n
one as read.
Could you explain more what you're looking to do?