Remove Link Items From WordPress Admin Bar 3.3

This function removes links from the WordPress admin bar. You can customize by choosing which links to remove. If you want to leave one of these items in, just delete the line.

//remove stuff from new admin bar for all
function isa_admin_bar() {
    global $wp_admin_bar;

//	if (!current_user_can('manage_options')) {//only for non-admins
// or 
//	if (!current_user_can('delete_others_posts')) {//only for Author-level and below

    $wp_admin_bar->remove_menu('view-site');    
    $wp_admin_bar->remove_menu('comments');

$wp_admin_bar->remove_menu('wp-logo');
//    $wp_admin_bar->remove_menu('about');
//    $wp_admin_bar->remove_menu('wporg');
//    $wp_admin_bar->remove_menu('documentation');
//    $wp_admin_bar->remove_menu('support-forums');
//    $wp_admin_bar->remove_menu('feedback');

$wp_admin_bar->remove_menu('new-content');
  $wp_admin_bar->remove_menu('new-link'); 
  $wp_admin_bar->remove_menu('new-media');
  $wp_admin_bar->remove_menu('new-page'); 
  $wp_admin_bar->remove_menu('new-user'); 
  $wp_admin_bar->remove_menu('new-post');

  $wp_admin_bar->remove_menu('new-custom_post_type');

  $wp_admin_bar->remove_menu('customize');// removes the Customize link

//	}// end only for non-admins, or end only for authors and below

}//end isa admin bar
add_action( 'wp_before_admin_bar_render', 'isa_admin_bar' );

See more: , , ,

We've One Response

Questions and Comments are Welcome

Your email address will not be published. All comments will be moderated.

Please wrap code in "code" bracket tags like this:

[code]

YOUR CODE HERE 

[/code]