BlackBox Debug Bar
[resolved] Display debug bar only to admins (4 posts)

  1. xclamation
    Posted 3 years ago #

    Hi Greg,

    First off, thanks for creating such a great plugin and releasing it for free.

    I use your plugin on my clients websites while the sites are in development to help me debug. However, sometimes I use your plugin on live websites in order to debug issues too.

    Could you possibly look at adding a conditional statement to only display the debug bar if the user is logged in as admin? I really don't see the point of displaying the debug bar to non-logged in users or basic 'subscribers'.




  2. Diego
    Posted 3 years ago #

    I had the same issue and I modified the plugin myself. The patched version can be found in my forked Git Repository.

  3. Greg Winiarski
    Plugin Author

    Posted 3 years ago #

    You can add following code in theme functions.php file (or put it in a new plugin)

    add_action("init", "blackbox_disable");
    function blackbox_disable() {
        if(!current_user_can("edit_plugins")) {
            remove_action('admin_footer', array("BlackBox_Hook", "footer"));
            remove_action('wp_footer', array("BlackBox_Hook", "footer"));

    this will disable BlackBox for all users except Administrators.

  4. xclamation
    Posted 3 years ago #

    Thanks to both daigo75 and Greg! I went with Gregs solution in the end.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • BlackBox Debug Bar
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic