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?

3 Answers
3

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 be echo wp_logout_url();

Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *