Ticket #229: bp_core_adminbar.php.adminlogoutcombo.patch
File bp_core_adminbar.php.adminlogoutcombo.patch, 1.4 KB (added by , 16 years ago) |
---|
-
bp-core-adminbar.php
75 75 76 76 $alt = ( $counter % 2 == 0 ) ? ' class="alt"' : ''; 77 77 78 echo '<li' . $alt . '><a id="logout" href="' . site_url() . '/wp-login.php?action=logout">' . __('Log Out', 'buddypress') . '</a></li>'; 78 if ( function_exists('wp_logout_url') ) { 79 echo '<li' . $alt . '><a id="logout" href="' . wp_logout_url(site_url()) . '">' . __( 'Log Out', 'buddypress' ) . '</a></li>'; 80 } else { 81 echo '<li' . $alt . '><a id="logout" href="' . site_url() . '/wp-login.php?action=logout&redirect_to=' . site_url() . '">' . __( 'Log Out', 'buddypress' ) . '</a></li>'; 82 } 83 79 84 echo '</ul>'; 80 85 echo '</li>'; 81 86 } … … 83 88 84 89 // return a string indicating user's role in that blog 85 90 function get_blog_role_for_user( $user, $blog ) { 91 if (is_site_admin() ) return __( 'Admin', 'buddypress'); // roles get confused with site admin 92 86 93 $roles = get_usermeta( $user, 'wp_' . $blog . '_capabilities' ); 87 94 88 95 if ( isset( $roles['subscriber'] ) ) … … 96 103 elseif ( isset( $roles['administrator'] ) ) 97 104 $role = __( 'Admin', 'buddypress' ); 98 105 else 99 return false;106 $role = ""; // we wouldn't be checking if there wasn't a user rec on this blog but ... 100 107 101 108 return $role; 102 109 }