Make WordPress Core


Ignore:
Timestamp:
11/07/2011 05:27:24 PM (15 years ago)
Author:
nacin
Message:

Clean up wp_admin_bar_my_account_menu() a bit. see #19193.

File:
1 edited

Legend:

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

    r19200 r19201  
    145145        $user_id      = get_current_user_id();
    146146        $current_user = wp_get_current_user();
     147        $profile_url  = get_edit_profile_url( $user_id );
    147148
    148149        if ( 0 != $user_id ) {
    149150                /* Add the 'My Account' menu */
    150                 $avatar = get_avatar( get_current_user_id(), 28 );
     151                $avatar = get_avatar( $user_id, 28 );
    151152                $howdy  = sprintf( __('Howdy, %1$s'), $user_identity );
    152153                $class  = 'opposite';
     
    158159                        'id'    => 'my-account',
    159160                        'title' => $howdy . $avatar,
    160                         'href'  => get_edit_profile_url( $user_id ),
     161                        'href'  => $profile_url,
    161162                        'meta'  => array(
    162163                                'class' => $class,
     
    166167                /* Add the "My Account" sub menus */
    167168
    168 
    169 
    170                 $user_info  = get_avatar( get_current_user_id(), 64 );
     169                $user_info  = get_avatar( $user_id, 64 );
    171170                $user_info .= "<span class='display-name'>{$current_user->display_name}</span>";
    172171
     
    178177                        'id'     => 'user-info',
    179178                        'title'  => $user_info,
    180                         'href'   => get_edit_profile_url( $user_id ),
     179                        'href'   => $profile_url,
    181180                        'meta'   => array(
    182                                 'class' => 'user-info user-info-item'
     181                                'class' => 'user-info user-info-item',
    183182                        ),
    184183                ) );
     
    187186                        'id'     => 'edit-profile',
    188187                        'title'  => __( 'Edit My Profile' ),
    189                         'href' => get_edit_profile_url( $user_id ),
     188                        'href' => $profile_url,
    190189                        'meta'   => array(
    191190                                'class' => 'user-info-item',
Note: See TracChangeset for help on using the changeset viewer.