MySites Menu Item not appearing in Admin Bar for some

I just recently upgraded to BP 1.5 and I tried to turn off the BP admin bar and use the built in WP bar.
In WP-config.php I have:
// Uncomment to disable the site admin bar
//define( 'NOADMINBAR', 1 );
//define( 'BP_DISABLE_ADMIN_BAR', true );
define( 'BP_USE_WP_ADMIN_BAR', true );

When I do this I have some users reporting that when they login on the main site the "MySites"admin bar drop down doesn't appear for them.

What would cause that? They all have at least 1 blog. Do they need to have more than one blog for that menu item to appear in the admin bar?

  • kennibc
    • The Crimson Coder

    Here is the code in Adminbar.php in wp-includes folder. How do I change it to make the MySites menu appear when you only have one blog?

     * Add the "My Sites/[Site Name]" menu and all submenus.
     * @since 3.1.0
    function wp_admin_bar_my_sites_menu( $wp_admin_bar ) {
    	global $wpdb;
    	/* Add the 'My Sites' menu if the user has more than one site. */
    	if ( count( $wp_admin_bar->user->blogs ) <= 1 )
    	$wp_admin_bar->add_menu( array(  'id' => 'my-blogs', 'title' => __( 'My Sites' ),  'href' => admin_url( 'my-sites.php' ) ) );
    	$default = includes_url('images/wpmini-blue.png');
  • Philip John
    • DEV MAN’s Apprentice

    You could simply remove lines 11 and 12 from that snippet.

    However, you should never edit WP core unless you absolutely have to and know exactly what you're doing.

    Your changes will get over-ridden in future updates and your changes could cause unintended consequences.


  • kennibc
    • The Crimson Coder

    I did just that with no luck. I actually had to uncomment this from the wp-config.php:
    // Uncomment to disable the site admin bar
    //define( 'NOADMINBAR', 1 );
    define( 'BP_DISABLE_ADMIN_BAR', true );
    define( 'BP_USE_WP_ADMIN_BAR', true );

    Then My Sites appeared for people only having one website in a multisite setup.

    Unfortunately they loose the BP menu items with this scenario.
    Hopefully there will be a better admin bar integration with future versions of BP so that users can have direct access to the My Sites if they only have one blog.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.