Changeset 7966 for trunk/bp-notifications/bp-notifications-loader.php
- Timestamp:
- 02/22/2014 09:21:21 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-notifications/bp-notifications-loader.php
r7936 r7966 105 105 public function setup_nav( $main_nav = array(), $sub_nav = array() ) { 106 106 107 // Only grab count if we're on a user page and current user has access 108 if ( bp_is_user() && bp_user_has_access() ) { 109 $count = bp_notifications_get_unread_notification_count( bp_displayed_user_id() ); 110 $class = ( 0 === $count ) ? 'no-count' : 'count'; 111 $nav_name = sprintf( __( 'Notifications <span class="%s">%s</span>', 'buddypress' ), esc_attr( $class ), number_format_i18n( $count ) ); 112 } else { 113 $nav_name = __( 'Notifications', 'buddypress' ); 114 } 115 107 116 // Add 'Notifications' to the main navigation 108 $count = bp_notifications_get_unread_notification_count( bp_displayed_user_id() );109 $class = ( 0 === $count ) ? 'no-count' : 'count';110 117 $main_nav = array( 111 'name' => sprintf( __( 'Notifications <span class="%s">%s</span>', 'buddypress' ), esc_attr( $class ), number_format_i18n( $count ) ),118 'name' => $nav_name, 112 119 'slug' => $this->slug, 113 120 'position' => 30,
Note: See TracChangeset
for help on using the changeset viewer.