mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 20:30:23 +00:00
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
git-svn-id: https://develop.svn.wordpress.org/trunk@16083 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -82,13 +82,15 @@ function wp_admin_bar_me_separator() {
|
||||
function wp_admin_bar_my_account_menu() {
|
||||
global $wp_admin_bar, $user_identity;
|
||||
|
||||
$user_id = get_current_user_id();
|
||||
|
||||
/* Add the 'My Account' menu */
|
||||
$wp_admin_bar->add_menu( array( 'id' => 'my-account', 'title' => $user_identity, 'href' => admin_url('profile.php'), ) );
|
||||
|
||||
/* Add the "My Account" sub menus */
|
||||
$wp_admin_bar->add_menu( array( 'parent' => 'my-account', 'title' => __( 'Edit My Profile' ), 'href' => admin_url('profile.php'), ) );
|
||||
$wp_admin_bar->add_menu( array( 'parent' => 'my-account', 'title' => __( 'Edit My Profile' ), 'href' => get_edit_profile_url( $user_id ) ) );
|
||||
if ( is_multisite() )
|
||||
$wp_admin_bar->add_menu( array( 'parent' => 'my-account', 'title' => __( 'Global Dashboard' ), 'href' => admin_url(), ) );
|
||||
$wp_admin_bar->add_menu( array( 'parent' => 'my-account', 'title' => __( 'Dashboard' ), 'href' => get_dashboard_url( $user_id ), ) );
|
||||
else
|
||||
$wp_admin_bar->add_menu( array( 'parent' => 'my-account', 'title' => __( 'Dashboard' ), 'href' => admin_url(), ) );
|
||||
$wp_admin_bar->add_menu( array( 'parent' => 'my-account', 'title' => __( 'Log Out' ), 'href' => wp_logout_url(), ) );
|
||||
|
||||
Reference in New Issue
Block a user