Change WordPress user roles and capabilities › Forums › Give user access to plugin – how to › How to display admin bar for some user role › Reply To: How to display admin bar for some user role
05/08/2015 at 16:54
#1604
Vladimir
Keymaster
Hi,
This code shows admin top menu bar for the role:
add_action('wp_head', 'show_top_admin_menu_bar', 100);
function show_top_admin_menu_bar() {
if (current_user_can('some_role')) {
show_admin_bar(true);
}
}
Pay attention for the 100 value of a priority parameter. With this value code should be executed after that other plugin did its work.
You may add it to the functions.php file of your active theme.