Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Add Notification number to template
- */
- function my_bp_adminbar_notifications_menu() {
- global $bp;
- if ( !is_user_logged_in() )
- return false;
- echo '<div class="notices"><ul class="notices">';
- _e( '', 'buddypress' );
- if ( $notifications = bp_notifications_get_notifications_for_user( $bp->loggedin_user->id ) ) { ?>
- <li class="parent"><span class="notice-badge"><?php echo count( $notifications ) ?></span>
- <?php
- }
- echo '</a>';
- echo '<ul class="sub-menu">';
- if ( $notifications ) {
- $counter = 0;
- for ( $i = 0; $i < count($notifications); $i++ ) {
- $alt = ( 0 == $counter % 2 ) ? ' class="alt"' : ''; ?>
- <li<?php echo $alt ?>><?php echo $notifications[$i] ?></li>
- <?php $counter++;
- }
- } else { ?>
- <li><a href="<?php echo $bp->loggedin_user->domain ?>"><?php _e( '<div class="icon"></div>', 'buddypress' ); ?></a></li>
- <?php
- }
- echo '</ul></li>';
- echo '</ul></div>';
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement