Make WordPress Core


Ignore:
Timestamp:
10/29/2010 05:48:53 PM (14 years ago)
Author:
ryan
Message:

get_dashboard_url() and get_edit_profile_url(). Determine the appropriate dahboard for a user based on the user's blogs and the current blog. see #14696 #14772

File:
1 edited

Legend:

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

    r16082 r16083  
    8383    global $wp_admin_bar, $user_identity;
    8484
     85    $user_id = get_current_user_id();
     86
    8587    /* Add the 'My Account' menu */
    8688    $wp_admin_bar->add_menu( array( 'id' => 'my-account', 'title' => $user_identity,  'href' => admin_url('profile.php'), ) );
    8789
    8890    /* Add the "My Account" sub menus */
    89     $wp_admin_bar->add_menu( array( 'parent' => 'my-account', 'title' => __( 'Edit My Profile' ), 'href' => admin_url('profile.php'), ) );
     91    $wp_admin_bar->add_menu( array( 'parent' => 'my-account', 'title' => __( 'Edit My Profile' ), 'href' => get_edit_profile_url( $user_id ) ) );
    9092    if ( is_multisite() )
    91         $wp_admin_bar->add_menu( array( 'parent' => 'my-account', 'title' => __( 'Global Dashboard' ), 'href' => admin_url(), ) );
     93        $wp_admin_bar->add_menu( array( 'parent' => 'my-account', 'title' => __( 'Dashboard' ), 'href' => get_dashboard_url( $user_id ), ) );
    9294    else
    9395        $wp_admin_bar->add_menu( array( 'parent' => 'my-account', 'title' => __( 'Dashboard' ), 'href' => admin_url(), ) );
Note: See TracChangeset for help on using the changeset viewer.