Skip to:
Content

BuddyPress.org

Changeset 9531


Ignore:
Timestamp:
02/23/2015 12:42:43 AM (5 years ago)
Author:
johnjamesjacoby
Message:

Blogs: Update main-nav text to include classes, to match other similar components. Props hnla. Fixes #6207.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-blogs/bp-blogs-loader.php

    r9351 r9531  
    154154
    155155        // Add 'Sites' to the main navigation
    156         $main_nav =  array(
    157             'name'                => sprintf( __( 'Sites <span>%d</span>', 'buddypress' ), bp_get_total_blog_count_for_user() ),
     156        $count    = (int) bp_get_total_blog_count_for_user();
     157        $class    = ( 0 === $count ) ? 'no-count' : 'count';
     158        $nav_text = sprintf( __( 'Sites <span class="%s">%s</span>', 'buddypress' ), esc_attr( $class ), number_format_i18n( $count )  );
     159        $main_nav = array(
     160            'name'                => $nav_text,
    158161            'slug'                => $this->slug,
    159162            'position'            => 30,
Note: See TracChangeset for help on using the changeset viewer.