[wp-trac] [WordPress Trac] #18990: My Sites menu appears for 1 item

WordPress Trac wp-trac at lists.automattic.com
Tue Oct 18 20:35:41 UTC 2011


#18990: My Sites menu appears for 1 item
----------------------------+------------------
 Reporter:  kawauso         |       Owner:
     Type:  defect (bug)    |      Status:  new
 Priority:  normal          |   Milestone:  3.3
Component:  Administration  |     Version:  3.3
 Severity:  normal          |  Resolution:
 Keywords:  needs-patch     |
----------------------------+------------------
Description changed by kawauso:

Old description:

> In `wp_admin_bar_my_sites_menu()`, there's the following:
>
> {{{
>         // Show only when there are more than two items in the menu.
>         if ( count( $wp_admin_bar->user->blogs ) <= 1 && !
> is_super_admin() )
>                 return;
> }}}
>
> However, it also then skips the current blog item in certain
> circumstances:
>
> {{{
>                 // Skip the current blog (unless we're in the
> network/user admin).
>                 if ( $blog->userblog_id == get_current_blog_id() && !
> is_network_admin() && ! is_user_admin() ) {
>                         continue;
>                 }
> }}}
>
> Which throws the count out of the window.

New description:

 In `wp_admin_bar_my_sites_menu()`, there's the following:

 {{{
         // Show only when there are more than two items in the menu.
         if ( count( $wp_admin_bar->user->blogs ) <= 1 && !
 is_super_admin() )
                 return;
 }}}

 However, it also then skips the current blog item in certain
 circumstances:

 {{{
                 // Skip the current blog (unless we're in the network/user
 admin).
                 if ( $blog->userblog_id == get_current_blog_id() && !
 is_network_admin() && ! is_user_admin() ) {
                         continue;
                 }
 }}}

 Which throws the count out of the window.

 '''Steps to reproduce:'''
 1. Visit a site where the current user has capabilities, has capabilities
 on one other site and isn't a super admin
 1. The current site will be hidden from the My Sites admin bar menu, but
 will still appear.

--

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/18990#comment:3>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list