Skip to:
Content
Pages
Categories
Search
Top
Bottom

Adds a navigation item to user profiles with counter


  • RikkivonTikki
    Participant

    @rikkivontikki

    Hey guys,
    I’ve a little question. Have you any example codes with bp_core_new_nav_item() function that add a counter like a messages, notification or friend tab?

    regards and thanks

Viewing 2 replies - 1 through 2 (of 2 total)

  • shanebp
    Moderator

    @shanebp

    $count  = // code that retrieves the count
    $class  = ( 0 === $count ) ? 'no-count' : 'count';
    
    bp_core_new_nav_item( array(
        'name'  =>  sprintf( __( 'Animals <span class="%s">%s</span>', 'lang-domain' ), esc_attr( $class ), number_format_i18n( $count ) ),
        // etc

    RikkivonTikki
    Participant

    @rikkivontikki

    Thanks a lot, working.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Adds a navigation item to user profiles with counter’ is closed to new replies.
Skip to toolbar