Changeset 7521 for trunk/bp-members/bp-members-buddybar.php
- Timestamp:
- 11/07/2013 05:15:51 PM (13 years ago)
- File:
-
- 1 edited
-
trunk/bp-members/bp-members-buddybar.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-members/bp-members-buddybar.php
r6760 r7521 18 18 function bp_adminbar_notifications_menu() { 19 19 20 if ( !is_user_logged_in() ) 20 // Bail if notifications is not active 21 if ( ! bp_is_active( 'notifications' ) ) { 21 22 return false; 22 23 echo '<li id="bp-adminbar-notifications-menu"><a href="' . bp_loggedin_user_domain() . '">';24 _e( 'Notifications', 'buddypress' );25 26 if ( $notifications = bp_core_get_notifications_for_user( bp_loggedin_user_id() ) ) { ?>27 <span><?php echo count( $notifications ) ?></span>28 <?php29 23 } 30 24 31 echo '</a>'; 32 echo '<ul>'; 33 34 if ( $notifications ) { 35 $counter = 0; 36 for ( $i = 0, $count = count( $notifications ); $i < $count; ++$i ) { 37 $alt = ( 0 == $counter % 2 ) ? ' class="alt"' : ''; ?> 38 39 <li<?php echo $alt ?>><?php echo $notifications[$i] ?></li> 40 41 <?php $counter++; 42 } 43 } else { ?> 44 45 <li><a href="<?php echo bp_loggedin_user_domain() ?>"><?php _e( 'No new notifications.', 'buddypress' ); ?></a></li> 46 47 <?php 48 } 49 50 echo '</ul>'; 51 echo '</li>'; 25 bp_notifications_buddybar_menu(); 52 26 } 53 27 add_action( 'bp_adminbar_menus', 'bp_adminbar_notifications_menu', 8 );
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)