TeddyCoder | Web Freelancer in Hochiminh City

Hide Admin Bar (specific user)

function mytheme_admin_bar_render() {
global $wp_admin_bar;
if( !current_user_can( 'administrator' ) ):
$wp_admin_bar->remove_menu('new-content');
endif;
}
add_action( 'wp_before_admin_bar_render', 'mytheme_admin_bar_render' );

BACK