Ticket #16540: 16540.diff
File 16540.diff, 2.3 KB (added by , 14 years ago) |
---|
-
wp-includes/admin-bar.php
75 75 * 76 76 * @since 3.1.0 77 77 */ 78 function wp_admin_bar_my_account_menu( ) {79 global $ wp_admin_bar, $user_identity;78 function wp_admin_bar_my_account_menu( &$wp_admin_bar ) { 79 global $user_identity; 80 80 81 81 $user_id = get_current_user_id(); 82 82 … … 102 102 * 103 103 * @since 3.1.0 104 104 */ 105 function wp_admin_bar_my_sites_menu( ) {106 global $wpdb , $wp_admin_bar;105 function wp_admin_bar_my_sites_menu( &$wp_admin_bar ) { 106 global $wpdb; 107 107 108 108 /* Add the 'My Sites' menu if the user has more than one site. */ 109 109 if ( count( $wp_admin_bar->user->blogs ) <= 1 ) … … 137 137 * 138 138 * @since 3.1.0 139 139 */ 140 function wp_admin_bar_shortlink_menu() { 141 global $wp_admin_bar; 142 140 function wp_admin_bar_shortlink_menu( &$wp_admin_bar ) { 143 141 $short = wp_get_shortlink( 0, 'query' ); 144 142 $id = 'get-shortlink'; 145 143 … … 161 159 * 162 160 * @since 3.1.0 163 161 */ 164 function wp_admin_bar_edit_menu () { 165 global $wp_admin_bar; 166 162 function wp_admin_bar_edit_menu( &$wp_admin_bar ) { 167 163 $current_object = get_queried_object(); 168 164 169 165 if ( empty($current_object) ) … … 181 177 * 182 178 * @since 3.1.0 183 179 */ 184 function wp_admin_bar_new_content_menu() { 185 global $wp_admin_bar; 186 180 function wp_admin_bar_new_content_menu( &$wp_admin_bar ) { 187 181 $actions = array(); 188 182 foreach ( (array) get_post_types( array( 'show_ui' => true ), 'objects' ) as $ptype_obj ) { 189 183 if ( true !== $ptype_obj->show_in_menu || ! current_user_can( $ptype_obj->cap->edit_posts ) ) … … 207 201 * 208 202 * @since 3.1.0 209 203 */ 210 function wp_admin_bar_comments_menu() { 211 global $wp_admin_bar; 212 204 function wp_admin_bar_comments_menu( &$wp_admin_bar ) { 213 205 if ( !current_user_can('edit_posts') ) 214 206 return; 215 207 … … 225 217 * 226 218 * @since 3.1.0 227 219 */ 228 function wp_admin_bar_appearance_menu() { 229 global $wp_admin_bar; 230 220 function wp_admin_bar_appearance_menu( &$wp_admin_bar ) { 231 221 if ( !current_user_can('switch_themes') ) 232 222 return; 233 223 … … 248 238 * 249 239 * @since 3.1.0 250 240 */ 251 function wp_admin_bar_updates_menu() { 252 global $wp_admin_bar; 253 241 function wp_admin_bar_updates_menu( &$wp_admin_bar ) { 254 242 if ( !current_user_can('install_plugins') ) 255 243 return; 256 244