luizbills / wp-tweaks

Several opinionated wordpress tweaks focused in :shield: security and :zap: performance.
https://wordpress.org/plugins/wp-tweaks/
GNU General Public License v3.0
31 stars 8 forks source link

Remove Howdy from admin bar #4

Closed jukra closed 4 years ago

jukra commented 5 years ago

Removes Howdy text from admin bar. For issue https://github.com/luizbills/wp-tweaks/issues/3

luizbills commented 5 years ago

@jukra thanks man, I will to test soon

luizbills commented 5 years ago

Let me know if you have any questions.

luizbills commented 5 years ago

Btw, your code don't work in all languages. I suggest you something like this:

add_action( 'admin_bar_menu', 'wp_tweaks_remove_howdy', 11 );
function wp_tweaks_remove_howdy ( $wp_admin_bar ) {
    $current_user = wp_get_current_user();
    $avatar = get_avatar( $current_user->ID, 28 );

    $wp_admin_bar->add_node( [
        'id' => 'my-account',
        'title' => $current_user->display_name . $avatar
    ] );
}