Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
01/26/2014 02:53:22 PM (10 years ago)
Author:
djpaul
Message:

Navigation: add CSS classes for BP nav bar item counts

Allows themes to show/hide the bubble depending on if there is a count to display.

Fixes #5169, props markoheijnen

File:
1 edited

Legend:

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

    r7756 r7758  
    106106        // Add 'Notifications' to the main navigation
    107107        $count    = bp_notifications_get_unread_notification_count( bp_loggedin_user_id() );
     108        $class    = ( 0 === $count ) ? 'no-count' : 'count';
    108109        $main_nav = array(
    109             'name'                    => sprintf( __( 'Notifications <span>%d</span>', 'buddypress' ), number_format_i18n( $count ) ),
     110            'name'                    => sprintf( __( 'Notifications <span class="%s">%s</span>', 'buddypress' ), esc_attr( $class ), number_format_i18n( $count ) ),
    110111            'slug'                    => $this->slug,
    111112            'position'                => 30,
Note: See TracChangeset for help on using the changeset viewer.