Opened 16 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 | 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)
Change History (12)
#2
@
16 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.
#6
@
15 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
@
15 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 ;).
Screenie