Add/Remove unwanted links from wordpress admin bar

Remove links from wordpress admin bar:

Given below code remove the wordpress logo and other links from the admin bar.

function annointed_admin_bar_remove() {
global $wp_admin_bar;

/* Remove their stuff */
$wp_admin_bar->remove_menu(‘wp-logo’);
$wp_admin_bar->remove_menu(‘updates’);
$wp_admin_bar->remove_menu(‘view-site’);
$wp_admin_bar->remove_menu(‘new-link’);
$wp_admin_bar->remove_menu(‘new-user’);
$wp_admin_bar->remove_menu(‘new-post’);
$wp_admin_bar->remove_menu(‘comments’);
}

 

Add links in wordpress admin bar:

function annointed_admin_bar_remove() {
global $wp_admin_bar;

$wp_admin_bar->add_menu(array(
‘parent’ => ‘new-content’,
‘id’ => ‘areas-covered’,
‘title’ => __(‘Areas Covered’),
‘href’ => “post-new.php”)
);
}

Bansal Sumit

To seek challenging roles and to achieve excellence in the field of Open Source Web Technology with a profound spirit of commitment and dedication.

You may also like...

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.