Make WordPress Core


Ignore:
Timestamp:
04/18/2011 10:03:34 PM (13 years ago)
Author:
ryan
Message:

Used passed admin bar object instead of global. Props solarissmoke. fixes #16540

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/admin-bar.php

    r17508 r17658  
    7676 * @since 3.1.0
    7777 */
    78 function wp_admin_bar_my_account_menu() {
    79     global $wp_admin_bar, $user_identity;
     78function wp_admin_bar_my_account_menu( $wp_admin_bar ) {
     79    global $user_identity;
    8080
    8181    $user_id = get_current_user_id();
     
    103103 * @since 3.1.0
    104104 */
    105 function wp_admin_bar_my_sites_menu() {
    106     global $wpdb, $wp_admin_bar;
     105function wp_admin_bar_my_sites_menu( $wp_admin_bar ) {
     106    global $wpdb;
    107107
    108108    /* Add the 'My Sites' menu if the user has more than one site. */
     
    138138 * @since 3.1.0
    139139 */
    140 function wp_admin_bar_shortlink_menu() {
    141     global $wp_admin_bar;
    142 
     140function wp_admin_bar_shortlink_menu( $wp_admin_bar ) {
    143141    $short = wp_get_shortlink( 0, 'query' );
    144142    $id = 'get-shortlink';
     
    162160 * @since 3.1.0
    163161 */
    164 function wp_admin_bar_edit_menu () {
    165     global $wp_admin_bar;
    166 
     162function wp_admin_bar_edit_menu( $wp_admin_bar ) {
    167163    $current_object = get_queried_object();
    168164
     
    182178 * @since 3.1.0
    183179 */
    184 function wp_admin_bar_new_content_menu() {
    185     global $wp_admin_bar;
    186 
     180function wp_admin_bar_new_content_menu( $wp_admin_bar ) {
    187181    $actions = array();
    188182    foreach ( (array) get_post_types( array( 'show_ui' => true ), 'objects' ) as $ptype_obj ) {
     
    208202 * @since 3.1.0
    209203 */
    210 function wp_admin_bar_comments_menu() {
    211     global $wp_admin_bar;
    212 
     204function wp_admin_bar_comments_menu( $wp_admin_bar ) {
    213205    if ( !current_user_can('edit_posts') )
    214206        return;
     
    226218 * @since 3.1.0
    227219 */
    228 function wp_admin_bar_appearance_menu() {
    229     global $wp_admin_bar;
    230 
     220function wp_admin_bar_appearance_menu( $wp_admin_bar ) {
    231221    if ( !current_user_can('switch_themes') )
    232222        return;
     
    249239 * @since 3.1.0
    250240 */
    251 function wp_admin_bar_updates_menu() {
    252     global $wp_admin_bar;
    253 
     241function wp_admin_bar_updates_menu( $wp_admin_bar ) {
    254242    if ( !current_user_can('install_plugins') )
    255243        return;
Note: See TracChangeset for help on using the changeset viewer.