Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class BP_Notification_Widget extends WP_Widget {
- function bp_notification_widget() {
- parent::WP_Widget( false, $name = __( 'Notifications', 'buddypress' ) );
- }
- function widget($args) {
- global $bp;
- extract( $args );
- echo $before_widget;
- echo $before_title
- . $widget_name
- . $after_title;
- if ( $notifications = bp_core_get_notifications_for_user( bp_loggedin_user_id() ) ) {
- echo '<ul>';
- if ( $notifications ) {
- $counter = 0;
- for ( $i = 0; $i < count($notifications); $i++ ) {
- echo '<li>'.$notifications[$i].'</li>';
- }
- }
- echo '</ul>';
- }
- }
- }
- add_action('widgets_init', create_function('', 'return register_widget("BP_Notification_Widget");') );
Advertisement
Add Comment
Please, Sign In to add comment