[buddypress-trac] [BuddyPress] #616: Set a maximum number of blogs to show in the My Blogs dropdown

buddypress-trac at lists.automattic.com buddypress-trac at lists.automattic.com
Mon Apr 12 08:50:48 UTC 2010


#616: Set a maximum number of blogs to show in the My Blogs dropdown
-------------------------+--------------------------------------------------
 Reporter:  johnbillion  |       Owner:                         
     Type:  enhancement  |      Status:  new                    
 Priority:  minor        |   Milestone:  1.3                    
Component:  Core         |    Keywords:  has-patch needs-testing
-------------------------+--------------------------------------------------
Changes (by cnorris23):

  * keywords:  needs-patch => has-patch needs-testing
  * component:  => Core
  * milestone:  Future Release => 1.3


Comment:

 I've update the patch for trunk, and made it filterable. You can use it
 like so:

 {{{
 function myplugin_bp_adminbar_blogs_menu_blogs_count( $blogs_count ) {
         if ( (int) $blogs_count > 5)
                 $blogs['count'] = 4;

         return $blogs['count'];
 }
 add_filter( 'bp_adminbar_blogs_menu_blogs_count',
 'myplugin_bp_adminbar_blogs_menu_blogs_count' );
 }}}

 You would add this code to your bp-custom.php, functions.php, or put it in
 a plugin.

 Caveat - While fixing this, I realized this could end up causing problems,
 which would the require a more elaborate fix. In johnbillion's case, this
 would only show the first ten blogs ordered by blog id. What if a user's
 most visited blog was #11 on the list? That user would then have to take
 an extra step to get to that blog. Granted, there are ways around that
 issue, like adding a bookmark in the browser, but it's still an extra
 step. Maybe this won't be a big deal, since johnbillion's case seems like
 a fringe case, which is why I went ahead with updating the patch ;).

-- 
Ticket URL: <http://trac.buddypress.org/ticket/616#comment:7>
BuddyPress <http://buddypress.org/>
BuddyPress


More information about the buddypress-trac mailing list