I would like to know how I can remove content inside .ab-sub-wrapper but keep Log Out and Edit My Profile links? Just want to keep thing nice and tidy
1 Answer
You can use wordpress nodes to customize profile menu.
Add this in functions.php
add_action( 'admin_bar_menu', 'remove_my_account', 999 );
function remove_my_account( $wp_admin_bar ) {
$wp_admin_bar->remove_node( 'my-account' );
}
add_action( 'admin_bar_menu', 'add_logout', 999 );
function add_logout( $wp_admin_bar ) {
$args = array(
'id' => 'logout', // id of the existing child node (New > Post)
'title' => 'Logout', // alter the title of existing node
'parent' => 'top-secondary', // set parent
);
$wp_admin_bar->add_node( $args );
}
-
Thank you for the provided code. It is what I am after. Nice and simple exit button. Jul 15, 2018 at 6:09