Skip to:
Content

BuddyPress.org

Changeset 7628


Ignore:
Timestamp:
11/30/2013 06:47:24 AM (12 years ago)
Author:
johnjamesjacoby
Message:

Swap old Core notifications functions for new native Notifications components ones. Props r-a-y. See #5266.

Location:
trunk/bp-notifications
Files:
2 edited

Legend:

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

    r7545 r7628  
    2525    }
    2626
    27     $notifications = bp_core_get_notifications_for_user( bp_loggedin_user_id(), 'object' );
     27    $notifications = bp_notifications_get_notifications_for_user( bp_loggedin_user_id(), 'object' );
    2828    $count         = ! empty( $notifications ) ? count( $notifications ) : 0;
    2929    $alert_class   = (int) $count > 0 ? 'pending-count alert' : 'count no-alert';
    30     $menu_title    = '<span id="ab-pending-notifications" class="' . $alert_class . '">' . $count . '</span>';
     30    $menu_title    = '<span id="ab-pending-notifications" class="' . $alert_class . '">' . number_format_i18n( $count ) . '</span>';
    3131    $menu_link     = trailingslashit( bp_loggedin_user_domain() . bp_get_notifications_slug() );
    3232
  • trunk/bp-notifications/bp-notifications-buddybar.php

    r7521 r7628  
    2525    }
    2626
    27     echo '<li id="bp-adminbar-notifications-menu"><a href="' . bp_loggedin_user_domain() . '">';
     27    echo '<li id="bp-adminbar-notifications-menu"><a href="' . esc_url( bp_loggedin_user_domain() ) . '">';
    2828    _e( 'Notifications', 'buddypress' );
    2929
    30     if ( $notifications = bp_core_get_notifications_for_user( bp_loggedin_user_id() ) ) : ?>
    31         <span><?php echo count( $notifications ) ?></span>
     30    if ( $notifications = bp_notifications_get_notifications_for_user( bp_loggedin_user_id() ) ) : ?>
     31        <span><?php echo number_format_i18n( $notifications ); ?></span>
    3232    <?php
    3333    endif;
     
    4747    } else { ?>
    4848
    49         <li><a href="<?php echo bp_loggedin_user_domain() ?>"><?php _e( 'No new notifications.', 'buddypress' ); ?></a></li>
     49        <li><a href="<?php echo esc_url( bp_loggedin_user_domain() ); ?>"><?php _e( 'No new notifications.', 'buddypress' ); ?></a></li>
    5050
    5151    <?php
Note: See TracChangeset for help on using the changeset viewer.