Don't show duff links if someone decides that they want the admin bar for all users - even those who are logged out.
git-svn-id: http://svn.automattic.com/wordpress/trunk@16291 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
1f74ef6b02
commit
9acf6d451e
|
@ -71,7 +71,9 @@ add_action( 'admin_footer', 'wp_admin_bar_render', 1000 );
|
|||
*/
|
||||
function wp_admin_bar_me_separator() {
|
||||
global $wp_admin_bar;
|
||||
$wp_admin_bar->add_menu( array( 'id' => 'me', 'title' => get_avatar( get_current_user_id(), 16 ), 'href' => get_edit_profile_url( get_current_user_id() ), ) );
|
||||
$user_id = get_current_user_id();
|
||||
if ( 0 != $user_id )
|
||||
$wp_admin_bar->add_menu( array( 'id' => 'me', 'title' => get_avatar( get_current_user_id(), 16 ), 'href' => get_edit_profile_url( $user_id ), ) );
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -84,6 +86,7 @@ function wp_admin_bar_my_account_menu() {
|
|||
|
||||
$user_id = get_current_user_id();
|
||||
|
||||
if ( 0 != $user_id ) {
|
||||
/* Add the 'My Account' menu */
|
||||
$wp_admin_bar->add_menu( array( 'id' => 'my-account', 'title' => $user_identity, 'href' => get_edit_profile_url( $user_id ) ) );
|
||||
|
||||
|
@ -94,6 +97,7 @@ function wp_admin_bar_my_account_menu() {
|
|||
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(), ) );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue