Add menu id for admin-bar's dashboard and view-site link. Props szadok. fixes #17873
git-svn-id: https://develop.svn.wordpress.org/trunk@18333 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
ba11fe1ed2
commit
5068db5bb8
@ -88,8 +88,8 @@ function wp_admin_bar_my_account_menu( $wp_admin_bar ) {
|
||||
$wp_admin_bar->add_menu( array( 'id' => $id, 'title' => $avatar . $user_identity, 'href' => get_edit_profile_url( $user_id ) ) );
|
||||
|
||||
/* Add the "My Account" sub menus */
|
||||
$wp_admin_bar->add_menu( array( 'parent' => $id, 'title' => __( 'Edit My Profile' ), 'href' => get_edit_profile_url( $user_id ) ) );
|
||||
$wp_admin_bar->add_menu( array( 'parent' => $id, 'title' => __( 'Log Out' ), 'href' => wp_logout_url() ) );
|
||||
$wp_admin_bar->add_menu( array( 'id' => 'edit-profile', 'parent' => $id, 'title' => __( 'Edit My Profile' ), 'href' => get_edit_profile_url( $user_id ) ) );
|
||||
$wp_admin_bar->add_menu( array( 'id' => 'logout', 'parent' => $id, 'title' => __( 'Log Out' ), 'href' => wp_logout_url() ) );
|
||||
}
|
||||
}
|
||||
|
||||
@ -103,11 +103,11 @@ function wp_admin_bar_dashboard_view_site_menu( $wp_admin_bar ) {
|
||||
|
||||
if ( 0 != $user_id ) {
|
||||
if ( is_admin() )
|
||||
$wp_admin_bar->add_menu( array( 'title' => __( 'Visit Site' ), 'href' => home_url() ) );
|
||||
$wp_admin_bar->add_menu( array( 'id' => 'view-site', 'title' => __( 'Visit Site' ), 'href' => home_url() ) );
|
||||
elseif ( is_multisite() )
|
||||
$wp_admin_bar->add_menu( array( 'title' => __( 'Dashboard' ), 'href' => get_dashboard_url( $user_id ) ) );
|
||||
$wp_admin_bar->add_menu( array( 'id' => 'dashboard', 'title' => __( 'Dashboard' ), 'href' => get_dashboard_url( $user_id ) ) );
|
||||
else
|
||||
$wp_admin_bar->add_menu( array( 'title' => __( 'Dashboard' ), 'href' => admin_url() ) );
|
||||
$wp_admin_bar->add_menu( array( 'id' => 'dashboard', 'title' => __( 'Dashboard' ), 'href' => admin_url() ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user