Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
02/09/2012 09:06:00 PM (14 years ago)
Author:
johnjamesjacoby
Message:

Clean up notifications code, and prevent notification for inactive components from appearing. Fixes #3650.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-members/bp-members-adminbar.php

    r5522 r5680  
    1919 */
    2020function bp_members_admin_bar_my_account_menu() {
    21         global $bp, $wp_admin_bar, $wp_version;
     21        global $bp, $wp_admin_bar;
    2222
    2323        // Bail if this is an ajax request
     
    3333                // Create the main 'My Account' menu
    3434                $wp_admin_bar->add_menu( array(
    35                         //'parent' => 'my-account',
    3635                        'id'     => $bp->my_account_menu_id,
    3736                        'group'  => true,
     
    146145 */
    147146function bp_members_admin_bar_notifications_menu() {
    148         global $bp, $wp_admin_bar;
     147        global $wp_admin_bar;
    149148
    150149        if ( !is_user_logged_in() )
     
    152151
    153152        $notifications = bp_core_get_notifications_for_user( bp_loggedin_user_id(), 'object' );
    154         $count         = !empty( $notifications ) ? count( $notifications ) : '0';
     153        $count         = !empty( $notifications ) ? count( $notifications ) : 0;
    155154        $alert_class   = (int) $count > 0 ? 'pending-count alert' : 'count no-alert';
    156155        $menu_title    = '<span id="ab-pending-notifications" class="' . $alert_class . '">' . $count . '</span>';
     
    165164
    166165        if ( !empty( $notifications ) ) {
    167                 foreach ( (array)$notifications as $notification ) {
     166                foreach ( (array) $notifications as $notification ) {
    168167                        $wp_admin_bar->add_menu( array(
    169168                                'parent' => 'bp-notifications',
Note: See TracChangeset for help on using the changeset viewer.