I have been customising the admin bar
in version 3.3 to only have certain custom links with the following added to functions.php
:
function mytheme_admin_bar_render() {
global $wp_admin_bar;
$wp_admin_bar->remove_menu('site-name');
$wp_admin_bar->remove_menu('new-content');
$wp_admin_bar->remove_menu('updates');
$wp_admin_bar->remove_menu('comments');
$wp_admin_bar->remove_menu('edit-profile');
$wp_admin_bar->add_menu( array(
'id' => 'reports', 'title' => __( 'Reports'), 'href' => __('xyz.html'),
));
}
add_action( 'wp_before_admin_bar_render', 'mytheme_admin_bar_render' );
I’d now like to have the far right link that says Howdy, …, function as a Logout button.
Does anyone have any suggestions on how achieve this?
EDIT: This is obviously not a good idea if you want to be able to update – see comments below
As this site explains, you need to replace
<?php printf(__(âHowdy, %2$s!â), âprofile.phpâ, $user_identity) ?>
in the wordpress admin with in your case the word ‘logout.’ Then make the url beecho wp_logout_url();
Here is a simple solution I figured out by reverse engineering this plugin: http://wordpress.org/extend/plugins/dashboard-tweaks/
This should hit the spot:
Modified version of:
http://wordpress.org/extend/plugins/one-click-logout/