Notifications
Clear all

Limited Support

Our support team is currently on holiday from December 25, 2025 to January 7, 2026, and replies may be delayed during this period.

We appreciate your patience and understanding while our team is away. Thank you for being part of the wpForo community!

Merry Christmas and Happy Holidays! 🎄

Script [Closed] Admin Bar for editors custom code?

2 Posts
2 Users
0 Reactions
3,095 Views
Posts: 1
Topic starter
(@willcrall)
New Member
Joined: 8 years ago

I'm curious if there is any work around with code or other means to allow the admin bar for editors without enabling for all members? 


Topic Tags
1 Reply
Robert
Posts: 10591
Admin
(@robert)
Support Team
Joined: 10 years ago

You can use this code in your current active theme functions.php

function my_admin_bar_control_function() {
if (current_user_can('administrator') || current_user_can('editor') ) {
show_admin_bar(true);
} else {
show_admin_bar(false);
}
}
add_action('init', 'my_admin_bar_control_function', 20);

How to Easily Add Custom Code in WordPress (without Breaking Your Site)