Skip to:
Content

BuddyPress.org

Opened 15 years ago

Closed 14 years ago

#616 closed enhancement (wontfix)

[patch] Set a maximum number of blogs to show in the My Blogs dropdown

Reported by: johnbillion's profile johnbillion Owned by:
Milestone: 1.5 Priority: minor
Severity: Version: 1.0
Component: Core Keywords: has-patch needs-testing
Cc:

Description

Some users (particularly admins) can belong to many blogs and the My Blogs dropdown list gets a little unwieldy.

How about setting a maximum of 10 blogs to show up in this list, with a menu option at the bottom to view all blogs if it does get cropped?

Attachments (3)

myblogs.png (9.2 KB) - added by johnbillion 15 years ago.
Screenie
616.patch (596 bytes) - added by johnbillion 15 years ago.
616.001.diff (909 bytes) - added by cnorris23 14 years ago.

Download all attachments as: .zip

Change History (12)

@johnbillion
15 years ago

Screenie

@johnbillion
15 years ago

#1 @johnbillion
15 years ago

  • Keywords has-patch added

Patch

#2 @johnbillion
15 years ago

Crap. A side effect of this is that there is no link to the admin area on blogs that aren't shown in the dropdown.

Possible solution: Add a link to wp-admin for each of the blogs on the My Blogs page.

#3 @nicolagreco
15 years ago

  • Milestone set to Blogs 1.0
  • Version set to 1.0

#4 @apeatling
15 years ago

  • Milestone changed from Blogs 1.0 to Blogs 1.1

#5 @(none)
15 years ago

  • Milestone Blogs 1.1 deleted

Milestone Blogs 1.1 deleted

#6 @cnorris23
14 years ago

  • Keywords needs-patch added; has-patch removed
  • Milestone set to Future Release

This needs to be rewritten for 1.2+. Additionally, max blogs shown should be filterable, and default to all blogs. If the max blogs shown variable is less than the blog count, you can then show the link to view all blogs. Hard-coding to 10 blogs shown, is the same as unlimited blogs shown, because it still limits your choices. As a filter, it can then be changed later by the site owner, either by plugin, or their theme's function.php.

#7 @cnorris23
14 years ago

  • Component set to Core
  • Keywords has-patch needs-testing added; needs-patch removed
  • Milestone changed from Future Release to 1.3

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 ;).

@cnorris23
14 years ago

#8 @paulhastings0
14 years ago

  • Summary changed from Set a maximum number of blogs to show in the My Blogs dropdown to [patch] Set a maximum number of blogs to show in the My Blogs dropdown

#9 @DJPaul
14 years ago

  • Resolution set to wontfix
  • Status changed from new to closed

As WP 3.1 has its own admin bar with similar functionality, I'm closing this ticket as we'll be re-doing our menu code.

Note: See TracTickets for help on using tickets.