How to remove wordpress logo from admin bar ?

by   SJRANJAN

To remove wordpress logo from the admin bar, paste the following code inside your theme or any active plugin...

Code

function remove_admin_bar_logo() {
    global $wp_admin_bar;
    $wp_admin_bar->remove_menu('wp-logo');
}
add_action( 'wp_before_admin_bar_render', 'remove_admin_bar_logo' );
 

Concept

Global variable $wp_admin_bar holds the default definition of admin bar. By the above code snippet we force wordpress to execute our function remove_admin_bar_logo on wp_before_admin_bar_render action. Where our function does removal of wordpress logo from $wp_admin_bar global variable.

Search

You may like...

How to change "Howdy" message in admin bar ?

To change / remove howdy message from the admin bar, paste the followi...