Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
01/26/2014 02:53:22 PM (11 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-friends/bp-friends-loader.php

    r7756 r7758  
    113113
    114114        // Add 'Friends' to the main navigation
     115        $count    = friends_get_total_friend_count();
     116        $class    = ( 0 === $count ) ? 'no-count' : 'count';
    115117        $main_nav = array(
    116             'name'                => sprintf( __( 'Friends <span>%d</span>', 'buddypress' ), friends_get_total_friend_count() ),
     118            'name'                => sprintf( __( 'Friends <span class="%s">%s</span>', 'buddypress' ), esc_attr( $class ), number_format_i18n( $count ) ),
    117119            'slug'                => $this->slug,
    118120            'position'            => 60,
Note: See TracChangeset for help on using the changeset viewer.