WordPress and buddypress programming

How to add a count in a custom tab in a Buddypress group

Viewing 0 reply threads
  • Author
    Posts
    • #1187
      michael mc
      Keymaster
      @michael
      function masta_add_namings_count( $count, $nav_item, $displayed_nav ) {
      
          if ( $displayed_nav == 'groups' ) {
      
              if ( $nav_item->slug == 'namings' ) {
      
                  $count = true;
      
              }
      
          }
      
          return $count;
      
      }
      add_filter( 'bp_nouveau_nav_has_count', 'masta_add_namings_count', 99, 3 );
      
      function masta_add_namings_count_int( $count, $nav_item, $displayed_nav ) {
      
          if ( $displayed_nav == 'groups' ) {
      
              if ( $nav_item->slug == 'namings' ) {
      
                  $group_id = bp_get_current_group_id();
      
                  $count = 666; // pass the group_id to a function that returns the proper count
      
              }
      
          }
      
          return $count;
      
      }
      add_filter( 'bp_nouveau_get_nav_count', 'masta_add_namings_count_int', 99, 3 );
Viewing 0 reply threads
  • You must be logged in to reply to this topic.