hide WordPress 3.1 admin menu
this is the simplest way. install showhide-adminbar. then all subscriber won’t see the adminbar even they set to show it in viewing site. http://wordpress.org/extend/plugins/showhide-adminbar/
this is the simplest way. install showhide-adminbar. then all subscriber won’t see the adminbar even they set to show it in viewing site. http://wordpress.org/extend/plugins/showhide-adminbar/
function hide_admin_bar_from_front_end(){ if (is_blog_admin()) { return true; } return false; } add_filter( ‘show_admin_bar’, ‘hide_admin_bar_from_front_end’ ); Edit: As @Walf suggested in the comments, this could be writen as: add_filter(‘show_admin_bar’, ‘is_blog_admin’);
See the Admin Bar remove_node function: add_action( ‘admin_bar_menu’, ‘remove_wp_nodes’, 999 ); function remove_wp_nodes() { global $wp_admin_bar; $wp_admin_bar->remove_node( ‘new-post’ ); $wp_admin_bar->remove_node( ‘new-link’ ); $wp_admin_bar->remove_node( ‘new-media’ ); }
Full example A quick (mu-)plugin as example: <?php /** Plugin Name: Add Admin Bar Icon */ add_action( ‘admin_bar_menu’, function( \WP_Admin_Bar $bar ) { $bar->add_menu( array( ‘id’ => ‘wpse’, ‘parent’ => null, ‘group’ => null, ‘title’ => __( ‘Example’, ‘some-textdomain’ ), ‘href’ => get_edit_profile_url( get_current_user_id() ), ‘meta’ => array( ‘target’ => ‘_self’, ‘title’ => __( ‘Hello’, … Read more