[buddypress-trac] [BuddyPress Trac] #6179: notification count doesn't match on admin bar

buddypress-trac noreply at wordpress.org
Tue Nov 8 20:08:44 UTC 2016


#6179: notification count doesn't match on admin bar
-------------------------------------------------+-------------------------
 Reporter:  danbp                                |       Owner:
     Type:  enhancement                          |  johnjamesjacoby
 Priority:  normal                               |      Status:  accepted
Component:  Toolbar & Notifications              |   Milestone:  2.8
 Severity:  normal                               |     Version:
 Keywords:  needs-unit-tests needs-testing       |  Resolution:
  needs-refresh                                  |
-------------------------------------------------+-------------------------
Changes (by mikeboltonca):

 * cc: mikebolton.ca@… (added)


Comment:

 I have discovered and partially* solved this issue over the past couple of
 days, and found this ticket after coming up with my solution.
 Since then, I tried the proposed change above:

 {{{
 $count = bp_get_total_mention_count_for_user( bp_loggedin_user_id() );
 }}}

 and found that the notification counter would show '0' regardless of how
 many notifications there were.

 In my solution, I changed that line to:


 {{{
 $count = ! empty( $notifications ) ?
 bp_notifications_get_unread_notification_count( bp_loggedin_user_id() ) :
 0;
 }}}

 This works as desired. It shows a count of individual notifications,
 rather than a count of groups of notifications.

 Something for your consideration.

 ----

 *I say "partially" only because I can't get the modified function to work
 in bp-custom.php or functions.php; it works flawlessly if I hack the core
 file bp-notifications-adminbar.php (not an acceptable solution). This is a
 problem with my level of experience, not the function.

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/6179#comment:12>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list