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' );
Shawn
June 21st, 2012 at 4:22 pm
Exactly what I needed…very cool! Thank you!!